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
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: