Skip to content

Commit

Permalink
Fix SA2.0 ORM usage in datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Sep 25, 2023
1 parent 4256d87 commit c410421
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/datatypes/display_applications/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def decode_dataset_user(trans, dataset_hash, user_hash):
# decode dataset id as usual
# decode user id using the dataset create time as the key
dataset_id = trans.security.decode_id(dataset_hash)
dataset = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(dataset_id)
dataset = trans.sa_session.get(trans.app.model.HistoryDatasetAssociation, dataset_id)
assert dataset, "Bad Dataset id provided to decode_dataset_user"
if user_hash in [None, "None"]:
user = None
else:
security = IdEncodingHelper(id_secret=dataset.create_time)
user_id = security.decode_id(user_hash)
user = trans.sa_session.query(trans.app.model.User).get(user_id)
user = trans.sa_session.get(trans.app.model.User, user_id)
assert user, "A Bad user id was passed to decode_dataset_user"
return dataset, user

0 comments on commit c410421

Please sign in to comment.