Browse Source

delete entry in database if error during mail sending occured

master
Benni Baermann 4 years ago
parent
commit
1c4d1b2e2e
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      input/views.py

+ 3
- 0
input/views.py View File

@ -192,10 +192,13 @@ class ExternView(CookieWizardView):
IF_EMAIL, IF_EMAIL,
[IF_EMAIL], [IF_EMAIL],
fail_silently=False) fail_silently=False)
# raise SMTPException("testing pupose only")
except BadHeaderError: except BadHeaderError:
modell.delete()
return HttpResponse('Invalid header found. Data not saved!') return HttpResponse('Invalid header found. Data not saved!')
except SMTPException: except SMTPException:
modell.delete()
return HttpResponse('Error in sending mails (propably wrong adress?). Data not saved!') return HttpResponse('Error in sending mails (propably wrong adress?). Data not saved!')

Loading…
Cancel
Save