From a97f306555d4f1f5250b3240493842615abfefb8 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 4 Oct 2023 16:41:24 -0500 Subject: [PATCH] fix: improve handling malformed new specific ipr submissions (#6420) --- ietf/ipr/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ietf/ipr/forms.py b/ietf/ipr/forms.py index cd4b406f9..fe4a70f8c 100644 --- a/ietf/ipr/forms.py +++ b/ietf/ipr/forms.py @@ -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