From d879cf389d32339dff6b075430938e1efd5b10ca Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Tue, 2 Apr 2019 12:03:07 +0200 Subject: [PATCH] Fixed bug change date --- IFPass.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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