From 78aef912d6a701a53648191c8329ef508ffbdda1 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Wed, 27 Jan 2021 09:51:18 +0100 Subject: [PATCH] Remove unnecessary app injection --- lib/galaxy/managers/tags.py | 10 +--------- lib/galaxy/webapps/galaxy/api/tags.py | 8 +++----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/galaxy/managers/tags.py b/lib/galaxy/managers/tags.py index 73f7b60660ab..0028a24ab774 100644 --- a/lib/galaxy/managers/tags.py +++ b/lib/galaxy/managers/tags.py @@ -8,7 +8,6 @@ Field, ) -from galaxy.app import StructuredApp from galaxy.managers.context import ProvidesUserContext @@ -33,14 +32,7 @@ class ItemTagsPayload(BaseModel): class TagsManager: """Interface/service object shared by controllers for interacting with tags.""" - def __init__(self, app: StructuredApp): - self._app = app - - def update( - self, - trans: ProvidesUserContext, - payload: ItemTagsPayload, - ) -> None: + def update(self, trans: ProvidesUserContext, payload: ItemTagsPayload) -> None: """Apply a new set of tags to an item; previous tags are deleted.""" tag_handler = trans.app.tag_handler new_tags: Optional[str] = None diff --git a/lib/galaxy/webapps/galaxy/api/tags.py b/lib/galaxy/webapps/galaxy/api/tags.py index 9cb4b02f4c4d..9af7182d5657 100644 --- a/lib/galaxy/webapps/galaxy/api/tags.py +++ b/lib/galaxy/webapps/galaxy/api/tags.py @@ -16,12 +16,10 @@ ItemTagsPayload, TagsManager, ) -from galaxy.structured_app import StructuredApp from galaxy.web import expose_api from galaxy.webapps.base.controller import BaseAPIController from . import ( Depends, - get_app, get_trans, ) @@ -30,8 +28,8 @@ router = APIRouter(tags=['tags']) -def get_tags_manager(app: StructuredApp = Depends(get_app)) -> TagsManager: - return TagsManager(app) # TODO: remove/refactor after merging #11180 +def get_tags_manager() -> TagsManager: + return TagsManager() # TODO: remove/refactor after merging #11180 @cbv(router) @@ -64,7 +62,7 @@ class TagsController(BaseAPIController): def __init__(self, app): super().__init__(app) - self.manager = TagsManager(app) + self.manager = TagsManager() # Retag an item. All previous tags are deleted and new tags are applied. @expose_api