Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Oct 25, 2024
1 parent c9b6d97 commit b5b8689
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/galaxy/managers/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def create_role(self, trans: ProvidesUserContext, role_definition_model: RoleDef
user_ids = role_definition_model.user_ids or []
group_ids = role_definition_model.group_ids or []

stmt = select(Role).where(Role.name == name).limit(1)
stmt = (
select(Role).where(Role.name == name).limit(1)
) # type:ignore[arg-type,comparison-overlap] # Role.name is a SA hybrid property
if trans.sa_session.scalars(stmt).first():
raise Conflict(f"A role with that name already exists [{name}]")

Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3776,7 +3776,7 @@ def name(self):
else:
return self._name

@name.setter
@name.setter # type:ignore[no-redef] # property setter
def name(self, name):
self._name = name

Expand Down

0 comments on commit b5b8689

Please sign in to comment.