[gestion] Adaptation de chambres_vides pour les déménagements par intranet
This commit is contained in:
parent
1ae148671d
commit
0907ab98d3
1 changed files with 15 additions and 3 deletions
|
@ -72,16 +72,28 @@ def warn_or_delete(smtp, clandestin, fail, done):
|
|||
mail_addr = clandestin.get_mail()
|
||||
if not clandestin.machines() or not mail_addr:
|
||||
return # Si pas de machine, on s'en fout. Si pas de mail, inutile
|
||||
try:
|
||||
data = {
|
||||
'dn': clandestin.dn.split(',')[0],
|
||||
'when': now.strftime('%Y/%M/%D %H:%m:%S:%s'),
|
||||
'chbre' : exchambre,
|
||||
}
|
||||
chbre_url = mail_module.validation_url('demenagement', data, True)
|
||||
chbre_url_error = u""
|
||||
except Exception as error:
|
||||
chbre_url_error = u"[[erreur de génération: %r]]" % error
|
||||
chbre_url = u""
|
||||
data = {
|
||||
"from" : RESP,
|
||||
"chambre" : exchambre,
|
||||
"jours" : (date_suppr - now).days+1,
|
||||
"to" : mail_addr,
|
||||
"adh": clandestin,
|
||||
"chbre_url" : chbre_url,
|
||||
"chbre_url_error" : chbre_url_error,
|
||||
"lang_info": "English version below",
|
||||
}
|
||||
mail = mail_module.generate('demenagement', data)
|
||||
smtp.sendmail(RESP, [mail_addr], mail.as_string())
|
||||
smtp.send_template('demenagement', data)
|
||||
|
||||
def format_entry(m):
|
||||
"""Renvoie une ligne de tableau, pour une machine"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue