Skip to content

Commit

Permalink
Remove unnecessary app injection
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jan 27, 2021
1 parent 83edefe commit 78aef91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
10 changes: 1 addition & 9 deletions lib/galaxy/managers/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Field,
)

from galaxy.app import StructuredApp
from galaxy.managers.context import ProvidesUserContext


Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions lib/galaxy/webapps/galaxy/api/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 78aef91

Please sign in to comment.