Merge pull request #1412 from mlorb/ml-sci-2893

Fix download exported project from email link [SCI-2893]
This commit is contained in:
mlorb 2018-12-10 09:48:00 +01:00 committed by GitHub
commit 33d5d2a1cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,12 @@
<%= I18n.t("notifications.deliver.download_link") %>
<% # work around the problem with inserting the link of zipExport %>
<% zip_id = /data-id=('|")(\d*)('|")/.match(@notification.message)[2] %>
<%= @notification.message.gsub(/href='.+'/, "href='#{zip_exports_download_url(zip_id)}'").html_safe %>
<% if /download_export_all_zip/.match(@notification.message) %>
<% download_url = zip_exports_download_export_all_url(zip_id) %>
<% else %>
<% download_url = zip_exports_download_url(zip_id) %>
<% end %>
<%= @notification.message.gsub(/href='.+'/, "href='#{download_url}'").html_safe %>
<% else %>
<%= sanitize_input(prepend_server_url_to_links(@notification.message)) %>
<% end %>