From 1c4d1b2e2e8877f6e790422be6be3a5ff61f2501 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 16 Nov 2020 16:10:31 +0100 Subject: [PATCH] delete entry in database if error during mail sending occured --- input/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/input/views.py b/input/views.py index 83df689..6233fef 100644 --- a/input/views.py +++ b/input/views.py @@ -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!')