1
0
Fork 0

delete entry in database if error during mail sending occured

This commit is contained in:
Benni Bärmann 2020-11-16 16:10:31 +01:00
parent 06a3d727ca
commit 1c4d1b2e2e
1 changed files with 3 additions and 0 deletions

View File

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