mail_invalide: pose bl même si pas de chbre
This commit is contained in:
parent
9b0b8faf1e
commit
22725efddc
1 changed files with 17 additions and 11 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue