mail_invalide: pose bl même si pas de chbre

This commit is contained in:
Daniel STAN 2015-02-06 18:09:33 +01:00
parent 9b0b8faf1e
commit 22725efddc

View file

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