fix: improve handling malformed new specific ipr submissions (#6420)

This commit is contained in:
Robert Sparks 2023-10-04 16:41:24 -05:00 committed by GitHub
parent 9a09bf1f7b
commit a97f306555
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,9 @@ class DraftForm(forms.ModelForm):
cleaned_data = super().clean()
revisions = cleaned_data.get("revisions")
document = cleaned_data.get("document")
if not document.name.startswith("rfc"):
if not document:
self.add_error("document", "Identifying the Internet-Draft or RFC for this disclosure is required.")
elif not document.name.startswith("rfc"):
if revisions.strip() == "":
self.add_error("revisions", "Revisions of this Internet-Draft for which this disclosure is relevant must be specified.")
return cleaned_data