Skip to content

Commit

Permalink
Raise exception if no Library found in api method
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Sep 22, 2023
1 parent 4accf95 commit da8f8ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/galaxy/webapps/galaxy/api/library_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def traverse(folder):
return rval

library = trans.sa_session.get(Library, self.decode_id(library_id))
if not library:
raise exceptions.RequestParameterInvalidException("No library found with the id provided.")
if not (trans.user_is_admin or trans.app.security_agent.can_access_library(current_user_roles, library)):
raise exceptions.RequestParameterInvalidException("No library found with the id provided.")
encoded_id = f"F{trans.security.encode_id(library.root_folder.id)}"
Expand Down

0 comments on commit da8f8ec

Please sign in to comment.