Merged in [16599] from rjsparks@nostrum.com:

Correct the uploaded_filename for slides that go through the approve-proposed-slides workflow.
 - Legacy-Id: 16644
Note: SVN reference [16599] has been migrated to Git commit f6b05ae963b9933dc8522f5db86eb33086d8f040
This commit is contained in:
Henrik Levkowetz 2019-08-10 17:29:51 +00:00
parent 8a9e6911cd
commit 7e34b3cd60

View file

@ -2482,14 +2482,14 @@ def approve_proposed_slides(request, slidesubmission_id, num):
if other_session != submission.session and not other_session.sessionpresentation_set.filter(document=doc).exists():
max_order = other_session.sessionpresentation_set.filter(document__type='slides').aggregate(Max('order'))['order__max'] or 0
other_session.sessionpresentation_set.create(document=doc,rev=doc.rev,order=max_order+1)
doc.uploaded_filename = submission.filename
sub_name, sub_ext = os.path.splitext(submission.filename)
target_filename = '%s-%s%s' % (sub_name[:sub_name.rfind('-ss')],doc.rev,sub_ext)
doc.uploaded_filename = target_filename
e = NewRevisionDocEvent.objects.create(doc=doc,by=submission.submitter,type='new_revision',desc='New revision available: %s'%doc.rev,rev=doc.rev)
doc.save_with_history([e])
path = os.path.join(submission.session.meeting.get_materials_path(),'slides')
if not os.path.exists(path):
os.makedirs(path)
sub_name, sub_ext = os.path.splitext(submission.filename)
target_filename = '%s-%s%s' % (sub_name[:sub_name.rfind('-ss')],doc.rev,sub_ext)
os.rename(submission.staged_filepath(), os.path.join(path, target_filename))
post_process(doc)
acronym = submission.session.group.acronym