The current validator stopped after 5 digits, whereas there can
be an aribtrary amount. However, the MITRE docs appear to stop at
7, so this seems like a sane cut-off, until it's not[1].
[1] https://cve.mitre.org/cve/identifiers/syntaxchange.html#new
)
-re_cve = re.compile(r'^(\d{4})-(\d{4,5})$')
+re_cve = re.compile(r'^(\d{4})-(\d{4,7})$')
def cve_validator(val):
if not re_cve.match(val):
- raise ValidationError("Enter CVE in format 0000-0000 without the CVE text")
+ raise ValidationError("Enter CVE in format (YYYY-NNNN (up to 7 N) without the CVE text")
def other_vectors_validator(val):