Check if guild is None in can user see check
All checks were successful
Deploy prod on push / pre-build (push) Successful in 2s
Deploy prod on push / build-bot (push) Successful in 7m20s
Deploy prod on push / build-web (push) Successful in 2m36s
Deploy prod on push / deploy (push) Successful in 1m29s

This commit is contained in:
Sven Heidemann 2024-02-25 13:42:09 +01:00
parent 179c8a954b
commit bdd0da38ab

View File

@ -91,9 +91,7 @@ class QueryABC(ObjectType):
for u in user.users:
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
if permissions.is_member_technician(guild.get_member(u.discord_id)):
if guild is not None and permissions.is_member_technician(guild.get_member(u.discord_id)):
return True
if config.get_configuration(MAINTENANCE):
@ -114,7 +112,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
access = True
@ -126,7 +124,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.auto_role.server.id:
access = True
@ -144,7 +142,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member):
access = True
@ -169,7 +167,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if u.id == element.id or permissions.is_member_moderator(member):
access = True
@ -180,7 +178,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -191,7 +189,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -202,7 +200,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -213,7 +211,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -224,7 +222,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_technician(member):
access = True
@ -236,7 +234,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
access = True
@ -248,7 +246,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
access = True
@ -259,7 +257,7 @@ class QueryABC(ObjectType):
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
continue
member = guild.get_member(u.discord_id)
if permissions.is_member_technician(member):
access = True