Skip to content

Commit

Permalink
Improve redirect in destroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dolski committed Jan 16, 2024
1 parent 4e35e22 commit 8a9d585
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/controllers/imports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@ def destroy
message: "The import into \"#{@import.collection.title}\" has "\
"been deleted.")
ensure
if current_user_is_sysadmin?
redirect_to institution_path(institution)
else
redirect_to imports_path
end
redirect_back fallback_location: current_user_is_sysadmin? ?
institution_path(institution) : imports_path
end

##
Expand Down

0 comments on commit 8a9d585

Please sign in to comment.