Skip to content

Commit ac69d98

Browse files
committed
Added a guard against feeding int() a non-numeric string during submission confirmation and a log assertion to report same.
- Legacy-Id: 14202
1 parent 8929437 commit ac69d98

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ietf/submit/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def validate_submission_rev(name, rev):
9090
return 'Revision must be between 00 and 99'
9191

9292
expected = 0
93-
existing_revs = [int(i.rev) for i in Document.objects.filter(name=name)]
93+
existing_revs = [int(i.rev) for i in Document.objects.filter(name=name) if i.rev and i.rev.isdigit() ]
94+
log.assertion('[ i.rev for i in Document.objects.filter(name=name) if not (i.rev and i.rev.isdigit()) ] == []')
9495
if existing_revs:
9596
expected = max(existing_revs) + 1
9697

0 commit comments

Comments
 (0)