Skip to content

Commit dedf681

Browse files
committed
Updated the meeting materials document view to handle urls with revisions.
- Legacy-Id: 14825
1 parent 088b7bf commit dedf681

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

ietf/meeting/views.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,17 @@ def current_materials(request):
158158
def materials_document(request, document, num=None, ext=None):
159159
if num is None:
160160
num = get_meeting(num).number
161-
doc = get_object_or_404(Document, name=document)
161+
if re.search('-\d\d$', document):
162+
name, rev = document.rsplit('-', 1)
163+
doc = get_object_or_404(Document, name=name)
162164
if not doc.meeting_related():
163165
raise Http404("Not a meeting related document")
164166
if not doc.session_set.filter(meeting__number=num).exists():
165167
raise Http404("No such document for meeting %s" % num)
166-
filename = doc.get_file_name()
168+
if not rev:
169+
filename = doc.get_file_name()
170+
else:
171+
filename = os.path.join(doc.get_file_path(), document)
167172
if ext and not filename.endswith(ext):
168173
name, _ = os.path.splitext(filename)
169174
filename = name + ext

0 commit comments

Comments
 (0)