From ac69d9889d395d8b1759db68b3ba630ad2c7da7d Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 10 Oct 2017 15:02:00 +0000 Subject: [PATCH] Added a guard against feeding int() a non-numeric string during submission confirmation and a log assertion to report same. - Legacy-Id: 14202 --- ietf/submit/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ietf/submit/utils.py b/ietf/submit/utils.py index ccabac8df..c40a58867 100644 --- a/ietf/submit/utils.py +++ b/ietf/submit/utils.py @@ -90,7 +90,8 @@ def validate_submission_rev(name, rev): return 'Revision must be between 00 and 99' expected = 0 - existing_revs = [int(i.rev) for i in Document.objects.filter(name=name)] + existing_revs = [int(i.rev) for i in Document.objects.filter(name=name) if i.rev and i.rev.isdigit() ] + log.assertion('[ i.rev for i in Document.objects.filter(name=name) if not (i.rev and i.rev.isdigit()) ] == []') if existing_revs: expected = max(existing_revs) + 1