diff --git a/IFPass.py b/IFPass.py index c9d9c99..585b657 100644 --- a/IFPass.py +++ b/IFPass.py @@ -436,9 +436,10 @@ def memberdo(choix, member): titre, firstname, surname, dateexp = memberedit(titre, firstname, surname, clientID, dateinsc, dateexp) elif choix == '2': # Renew subscription - print("1 - Renouveller l'abonnement automatiquement", "2 - Choisir la date d'expiration", sep='\n') - choix = input("Choix : ") - if choix == 1: + changeexp = yes_or_no("Voulez-vous choisir la date d'expiration ?") + if changeexp: + dateexp = getdateexp() + else: dateexp = datetime.strptime(dateexp, '%d/%m/%Y').date() diff = (dateexp - date.today()).days if diff >= 0: @@ -446,8 +447,6 @@ def memberdo(choix, member): elif diff < 0: dateexp = date.today() + timedelta(days=365) dateexp = dateexp.strftime('%d/%m/%Y') - elif choix == 2: - dateexp = getdateexp() if titre == 'Dr.': titrename = titre + ' ' + surname