save mail on database error
This commit is contained in:
parent
7de511ddd8
commit
4009a34728
4
main.py
4
main.py
@ -111,11 +111,11 @@ def submission ():
|
|||||||
except IndexError as e:
|
except IndexError as e:
|
||||||
save_mail (token, form['mail'], from_address, subject, content)
|
save_mail (token, form['mail'], from_address, subject, content)
|
||||||
response.status = 400
|
response.status = 400
|
||||||
return 'Le formulaire est introuvable'
|
return 'Le formulaire est introuvable. Le mail a été sauvegardé et sera traité à la main.'
|
||||||
except pymongo.errors.ServerSelectionTimeoutError as e:
|
except pymongo.errors.ServerSelectionTimeoutError as e:
|
||||||
save_mail (token, form['mail'], from_address, subject, content)
|
save_mail (token, form['mail'], from_address, subject, content)
|
||||||
response.status = 500
|
response.status = 500
|
||||||
return 'La base de donnée n’est pas accessible'
|
return 'La base de donnée n’est pas accessible. Votre message a été enregistré, il sera remis manuellement à son destinataire.'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subject_fields = fill_fields(request, get_fields(form['subject']))
|
subject_fields = fill_fields(request, get_fields(form['subject']))
|
||||||
|
Loading…
Reference in New Issue
Block a user