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 3m38s
Deploy prod on push / build-web (push) Successful in 2m41s
Deploy prod on push / deploy (push) Successful in 26s

This commit is contained in:
Sven Heidemann 2024-02-25 13:25:14 +01:00
parent 248d47c280
commit 179c8a954b

View File

@ -91,6 +91,8 @@ 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)):
return True
@ -111,6 +113,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
access = True
@ -121,6 +125,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.auto_role.server.id:
access = True
@ -137,6 +143,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member):
access = True
@ -160,6 +168,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if u.id == element.id or permissions.is_member_moderator(member):
access = True
@ -169,6 +179,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -178,6 +190,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -187,6 +201,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -196,6 +212,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
@ -205,6 +223,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_technician(member):
access = True
@ -215,6 +235,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
access = True
@ -225,6 +247,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
access = True
@ -234,6 +258,8 @@ class QueryABC(ObjectType):
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
if guild is None:
return False
member = guild.get_member(u.discord_id)
if permissions.is_member_technician(member):
access = True