Skip to content

Commit f6b05ae

Browse files
committed
Correct the uploaded_filename for slides that go through the approve-proposed-slides workflow. Commit ready for merge.
- Legacy-Id: 16599
1 parent c43dcaa commit f6b05ae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ietf/meeting/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,14 +2481,14 @@ def approve_proposed_slides(request, slidesubmission_id, num):
24812481
if other_session != submission.session and not other_session.sessionpresentation_set.filter(document=doc).exists():
24822482
max_order = other_session.sessionpresentation_set.filter(document__type='slides').aggregate(Max('order'))['order__max'] or 0
24832483
other_session.sessionpresentation_set.create(document=doc,rev=doc.rev,order=max_order+1)
2484-
doc.uploaded_filename = submission.filename
2484+
sub_name, sub_ext = os.path.splitext(submission.filename)
2485+
target_filename = '%s-%s%s' % (sub_name[:sub_name.rfind('-ss')],doc.rev,sub_ext)
2486+
doc.uploaded_filename = target_filename
24852487
e = NewRevisionDocEvent.objects.create(doc=doc,by=submission.submitter,type='new_revision',desc='New revision available: %s'%doc.rev,rev=doc.rev)
24862488
doc.save_with_history([e])
24872489
path = os.path.join(submission.session.meeting.get_materials_path(),'slides')
24882490
if not os.path.exists(path):
24892491
os.makedirs(path)
2490-
sub_name, sub_ext = os.path.splitext(submission.filename)
2491-
target_filename = '%s-%s%s' % (sub_name[:sub_name.rfind('-ss')],doc.rev,sub_ext)
24922492
os.rename(submission.staged_filepath(), os.path.join(path, target_filename))
24932493
post_process(doc)
24942494
acronym = submission.session.group.acronym

0 commit comments

Comments
 (0)