From 75b298deb8fccfb07e5a86e8b708e98c3f988659 Mon Sep 17 00:00:00 2001 From: John Davis Date: Fri, 25 Oct 2024 18:00:20 -0400 Subject: [PATCH] Fix mypy errors --- lib/galaxy/managers/roles.py | 6 +++++- lib/galaxy/model/__init__.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/managers/roles.py b/lib/galaxy/managers/roles.py index 8864f8900e16..02448c1a4fbc 100644 --- a/lib/galaxy/managers/roles.py +++ b/lib/galaxy/managers/roles.py @@ -84,7 +84,11 @@ 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) # type:ignore[arg-type,comparison-overlap] # Role.name is a SA hybrid property + .limit(1) + ) if trans.sa_session.scalars(stmt).first(): raise Conflict(f"A role with that name already exists [{name}]") diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 082f6791742e..738034e40dda 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -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