diff --git a/IFPass.py b/IFPass.py index cfdd26d..1ae0f1c 100644 --- a/IFPass.py +++ b/IFPass.py @@ -237,12 +237,7 @@ def writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new): csvfile.truncate(0) csvfile.write(content) - reader = csv.reader(csvfile, delimiter=';') - writer = csv.writer(csvfile, delimiter=';') - for index, member in enumerate(reader): - if member[3] == clientID: - - print(colored('[OK]', 'green')) + print(colored('[OK]', 'green')) def bkpdb(): @@ -351,7 +346,7 @@ def newmember(): if version not in ('dev', 'devnocam'): bkpdb() printcard(cartefilename) - writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=True) + writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=True) break @@ -421,6 +416,7 @@ def memberdo(choix, member): clientID = member[3] dateinsc = member[4] dateexp = member[5] + os.system('cls') if choix == '1': # Edit member while "the informations are incorrect": # Loop Filling informations @@ -439,19 +435,19 @@ def memberdo(choix, member): os.system('cls') if version != 'devnocam': picture = getpic() - clientID = member[3] - barcode = barcode_gen(clientID) - fillcard(clientID, titrename, firstname, dateexp, barcode, picture) - cartefilename = mergepdf() - if version not in ('dev', 'devnocam'): - bkpdb() - printcard(cartefilename) - writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=False) - break else: # We crop pic from the previous card pass + barcode = barcode_gen(clientID) + fillcard(clientID, titrename, firstname, dateexp, barcode, picture) + cartefilename = mergepdf() + if version not in ('dev', 'devnocam'): + bkpdb() + printcard(cartefilename) + writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=False) + break + elif choix == '2': # Renew subscription print(2) elif choix == '3': # Print card