From e65752e60b8a27db6193e5b79d053264522cc582 Mon Sep 17 00:00:00 2001 From: John Davis Date: Mon, 15 Apr 2024 16:47:25 -0400 Subject: [PATCH] Use session.get instead of custom method --- lib/galaxy/managers/libraries.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/galaxy/managers/libraries.py b/lib/galaxy/managers/libraries.py index 997638ea5205..d6fcb56b4e2a 100644 --- a/lib/galaxy/managers/libraries.py +++ b/lib/galaxy/managers/libraries.py @@ -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: @@ -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()