Skip to content

Commit aea0862

Browse files
committed
dev(WoRMS): mypy
1 parent 1893ac7 commit aea0862

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

py/API_operations/TaxoManager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ def add_worms_taxon(
9999
aphia_id: int,
100100
current_user_id: UserIDT,
101101
) -> Any:
102-
_user = RightsBO.user_can_add_taxonomy(self.ro_session, current_user_id)
103-
current_user: User = self.session.query(User).get(current_user_id)
102+
current_user = RightsBO.user_can_add_taxonomy(self.ro_session, current_user_id)
104103
taxon = {"aphia_id": aphia_id, "creator_email": current_user.email}
105104
ret = self.client.call("/addwormstaxon/", taxon)
106105
return ret.json()

py/BO/Rights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def get_allowed_actions(user: User) -> List[Action]:
230230
a_priv: ProjectPrivilege
231231
for a_priv in user.privs_on_projects:
232232
if a_priv.privilege == ProjectPrivilegeBO.MANAGE:
233-
# If any is managed, OK
233+
# If any is managed, OK for managing a bit of taxo
234234
ret.append(Action.CREATE_TAXON)
235235
break
236236
return ret

py/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,7 +3500,7 @@ def matching_with_worms_nice(
35003500
"/searchworms/{name}",
35013501
operation_id="search_worms_name",
35023502
tags=["Taxonomy Tree"],
3503-
response_model=Optional[List[Dict]],
3503+
response_model=Optional[List[Dict]], # type:ignore
35043504
)
35053505
def search_worms_name(
35063506
name: str,
@@ -3518,7 +3518,7 @@ def search_worms_name(
35183518
"/addworms/",
35193519
operation_id="add_worms_taxon",
35203520
tags=["Taxonomy Tree"],
3521-
response_model=Any,
3521+
response_model=Any, # type:ignore
35223522
)
35233523
def add_worms_taxon(
35243524
taxon: AddWormsTaxonModel = Body(...),

0 commit comments

Comments
 (0)