stick attachments links to backoffice when shown on backoffice (#47704)

This commit is contained in:
Thomas NOËL 2020-10-15 15:45:08 +02:00
parent 8407016c97
commit 9d0ca1c090
1 changed files with 3 additions and 2 deletions

View File

@ -63,8 +63,9 @@ def form_attachment(self):
if not isinstance(p, AttachmentEvolutionPart):
continue
if os.path.basename(p.filename) == fn:
return redirect( '%sfiles/attachment-%s/%s' % (
self.filled.get_url(), fn, urllib.quote(p.base_filename)))
is_in_backoffice = bool(get_request() and get_request().is_in_backoffice())
return redirect('%sfiles/attachment-%s/%s' % (
self.filled.get_url(backoffice=is_in_backoffice), fn, urllib.quote(p.base_filename)))
raise TraversalError()