diff --git a/admin/mail_invalide/mail_invalide.py b/admin/mail_invalide/mail_invalide.py index 1dba0764..763779af 100755 --- a/admin/mail_invalide/mail_invalide.py +++ b/admin/mail_invalide/mail_invalide.py @@ -88,17 +88,23 @@ def generate_ps(proprio, mail): raise def set_mail_invalide(adherent, mail, a_verifier, a_imprimer): - if adherent.chbre() not in ['????', 'EXT']: - print "Génération de la fiche pour %s :" % adherent.Nom().encode('utf-8') - fiche = generate_ps(adherent, mail) - print fiche - a_imprimer.append(fiche) - adherent.blacklist([time.time() + 14 * 24 * 3600, - '-', 'mail_invalide', "Mail invalide"]) - adherent.save() - else: - print u"Chambre de %s : %s, impossible de générer la fiche." % (adherent.Nom().encode('utf-8'), adherent.chbre()) - a_verifier.append(mail) + if adherent.chbre() in ['????', 'EXT']: + print u"Chambre de %s : %s, générer la fiche ? [Yn]" % (adherent.Nom().encode('utf-8'), adherent.chbre()) + read = '' + while read not in ['y', 'n']: + read = raw_input().lower() + if read == 'n': + print u"Chambre de %s : %s, impossible de générer la fiche." % (adherent.Nom().encode('utf-8'), adherent.chbre()) + a_verifier.append(mail) + return + + print "Génération de la fiche pour %s :" % adherent.Nom().encode('utf-8') + fiche = generate_ps(adherent, mail) + print fiche + a_imprimer.append(fiche) + adherent.blacklist([time.time() + 14 * 24 * 3600, + '-', 'mail_invalide', "Mail invalide"]) + adherent.save() if __name__ == "__main__": if '--help' in sys.argv or '-h' in sys.argv or len(sys.argv) < 2: