Skip to content
Snippets Groups Projects
Commit ee21f9f1 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Added error status to download if it cant find the link

parent a6a02074
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,12 @@ module DownloadableController ...@@ -4,7 +4,12 @@ module DownloadableController
# GET /learning_objects/1/download # GET /learning_objects/1/download
def download def download
downloadable.download(current_user, request.remote_ip) downloadable.download(current_user, request.remote_ip)
redirect_to downloadable.download_link link = downloadable.download_link
if !link.blank?
redirect_to link
else
render status: :internal_server_error
end
end end
protected protected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment