Skip to content

Commit

Permalink
Use session.get instead of custom method
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Jun 3, 2024
1 parent 338c1a1 commit e65752e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/galaxy/managers/libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get(self, trans, decoded_library_id: int, check_accessible: bool = True) ->
:rtype: galaxy.model.Library
"""
try:
library = get_library(trans.sa_session, decoded_library_id)
library = trans.sa_session.get(Library, decoded_library_id)
except MultipleResultsFound:
raise exceptions.InconsistentDatabase("Multiple libraries found with the same id.")
except NoResultFound:
Expand Down Expand Up @@ -364,8 +364,3 @@ def get_containing_library_from_library_dataset(trans, library_dataset) -> Optio
if library.root_folder == folder:
return library
return None


def get_library(session, library_id):
stmt = select(Library).where(Library.id == library_id)
return session.execute(stmt).scalar_one()

0 comments on commit e65752e

Please sign in to comment.