Skip to content

Commit 1bced6e

Browse files
committed
Tweaked the missing id submission revision message to work also with non-ascii characters in the draft name. Changed the disallowed character error message to be more useful by providing the found document name and byte codes for the disallowed characters.
- Legacy-Id: 9610
1 parent 213e769 commit 1bced6e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

ietf/submit/parsers/plain_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ def parse_name(self):
6060
extra_chars = re.sub('[0-9a-z\-]', '', name)
6161
if extra_chars:
6262
if len(extra_chars) == 1:
63-
self.parsed_info.add_error((u'The name contains a disallowed character: %s ' % (', '.join(set(extra_chars))).decode('ascii','replace')) +
63+
self.parsed_info.add_error((u'The document name on the first page, "%s", contains a disallowed character with byte code: %s ' % (name.decode('utf-8','replace'), ord(extra_chars[0]))) +
6464
u'(see https://www.ietf.org/id-info/guidelines.html#naming for details).')
6565
else:
66-
self.parsed_info.add_error((u'The name contains disallowed characters: %s ' % (', '.join(set(extra_chars))).decode('ascii','replace')) +
66+
self.parsed_info.add_error((u'The document name on the first page, "%s", contains disallowed characters with byte codes: %s ' % (name.decode('utf-8','replace'), (', '.join([ str(ord(c)) for c in extra_chars] )))) +
6767
u'(see https://www.ietf.org/id-info/guidelines.html#naming for details).')
6868
match_revision = revisionre.match(name)
6969
if match_revision:
7070
self.parsed_info.metadata.rev = match_revision.group(1)
7171
else:
72-
self.parsed_info.add_error(u'The name found on the first page of the document does not contain a revision: "%s"' % (name,))
72+
self.parsed_info.add_error(u'The name found on the first page of the document does not contain a revision: "%s"' % (name.decode('utf-8','replace'),))
7373
name = re.sub('-\d+$', '', name)
7474
self.parsed_info.metadata.name = name
7575
return
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div>{% for item in help_text_and_errors %} {{ item }}<br/> {% endfor %}</div>
2+

0 commit comments

Comments
 (0)