Fixed technician check when not on the server /2
Deploy prod on push / pre-build (push) Successful in 2s Details
Deploy prod on push / build-bot (push) Successful in 2m58s Details
Deploy prod on push / build-web (push) Successful in 1m43s Details
Deploy prod on push / deploy (push) Successful in 21s Details

This commit is contained in:
Sven Heidemann 2024-02-09 08:27:36 +01:00
parent dc5ae365bb
commit 521a063fca
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,8 @@ class AuthUserTransformer(TransformerABC):
def _is_technician(user: User, bot: DiscordBotServiceABC, permissions: PermissionServiceABC):
guild = bot.get_guild(user.server.discord_id)
member = guild.get_member(user.discord_id)
if member is None:
return permissions.is_member_technician_by_id(user.discord_id)
return permissions.is_member_technician(member)
@staticmethod

View File

@ -19,3 +19,7 @@ class PermissionServiceABC(ABC):
@abstractmethod
def is_member_technician(self, member: discord.Member) -> bool:
pass
@abstractmethod
def is_member_technician_by_id(self, member_id: int) -> bool:
pass