Added validation of successful draft title extraction on draft submission upload, to avoid a later exception when trying to store draft information for a draft with a null title.

- Legacy-Id: 7730
This commit is contained in:
Henrik Levkowetz 2014-05-10 10:39:33 +00:00
parent 4c03bc73d8
commit 2a8fbb4063

View file

@ -107,6 +107,9 @@ class UploadForm(forms.Form):
if not self.parsed_draft.filename:
raise forms.ValidationError("Draft parser could not extract a valid draft name from the .txt file")
if not self.parsed_draft.get_title():
raise forms.ValidationError("Draft parser could not extract a valid title from the .txt file")
# check group
self.group = self.deduce_group()