Another tweak to the rev pattern, and exception handling when breaking apart name an rev for documents which don't use the charter rev model.

- Legacy-Id: 13057
This commit is contained in:
Henrik Levkowetz 2017-03-22 09:50:07 +00:00
parent 5203118041
commit 9082b0abe5
2 changed files with 4 additions and 1 deletions

View file

@ -609,6 +609,9 @@ def document_html(request, name, rev=None):
name = "rfc" + name[3:].lstrip('0')
if name.startswith('review-') and re.search('-\d\d\d\d-\d\d$', name):
name = "%s-%s" % (name, rev)
if rev and not name.startswith('charter-') and re.search('[0-9]{1,2}-[0-9]{2}', rev):
name = "%s-%s" % (name, rev[:-3])
rev = rev[-2:]
docs = Document.objects.filter(docalias__name=name)
if not docs.exists():
# handle some special cases, like draft-ietf-tsvwg-ieee-802-11

View file

@ -531,7 +531,7 @@ URL_REGEXPS = {
"charter": r"(?P<name>charter-[-a-z0-9]+)",
"date": r"(?P<date>\d{4}-\d{2}-\d{2})",
"name": r"(?P<name>([A-Za-z0-9_+-]+?|%s))" % DRAFT_NAMES_WITH_DOT,
"rev": r"(?P<rev>[0-9-]{2})",
"rev": r"(?P<rev>[0-9]{1,2}(-[0-9]{2})?)",
"owner": r"(?P<owner>[-A-Za-z0-9\'+._]+@[A-Za-z0-9-._]+)",
"schedule_name": r"(?P<name>[A-Za-z0-9-:_]+)",
}