Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7fe3ed4df2
@ -79,9 +79,11 @@ class BaseForm(LoginRequiredMixin, CreateView):
|
|||||||
self.send_email()
|
self.send_email()
|
||||||
|
|
||||||
# Delete the corresponding draft
|
# Delete the corresponding draft
|
||||||
draft = CaseStudyDraft.objects.get(author=self.request.user)
|
try:
|
||||||
if draft:
|
draft = CaseStudyDraft.objects.get(author=self.request.user)
|
||||||
draft.delete()
|
draft.delete()
|
||||||
|
except CaseStudyDraft.DoesNotExist:
|
||||||
|
pass
|
||||||
|
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user