mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Use trans.sa_session instead of trans.app.model.session
Thanks David!
This commit is contained in:
@@ -46,7 +46,7 @@ class TagsManager:
|
||||
|
||||
def update(self, trans: ProvidesUserContext, payload: ItemTagsPayload) -> None:
|
||||
"""Apply a new set of tags to an item; previous tags are deleted."""
|
||||
tag_handler = GalaxyTagHandlerSession(trans.app.model.session)
|
||||
tag_handler = GalaxyTagHandlerSession(trans.sa_session)
|
||||
new_tags: Optional[str] = None
|
||||
if payload.item_tags and len(payload.item_tags) > 0:
|
||||
new_tags = ",".join(payload.item_tags)
|
||||
@@ -60,7 +60,7 @@ class TagsManager:
|
||||
"""
|
||||
Get an item based on type and id.
|
||||
"""
|
||||
tag_handler = GalaxyTagHandlerSession(trans.app.model.session)
|
||||
tag_handler = GalaxyTagHandlerSession(trans.sa_session)
|
||||
id = trans.security.decode_id(payload.item_id)
|
||||
item_class = tag_handler.item_tag_assoc_info[payload.item_class].item_class
|
||||
item = trans.sa_session.query(item_class).filter(item_class.id == id).first()
|
||||
|
||||
Reference in New Issue
Block a user