Fixed filter error #181

This commit is contained in:
Sven Heidemann 2023-02-13 22:20:53 +01:00
parent f435d779a7
commit 3844240930
3 changed files with 10 additions and 11 deletions

View File

@ -2,7 +2,6 @@ from enum import Enum
class UserRoleEnum(Enum): class UserRoleEnum(Enum):
member = 0 member = 0
moderator = 1 moderator = 1
admin = 2 admin = 2

View File

@ -66,7 +66,7 @@ class UserFilter(FilterABC):
def filter(self, query: List[User]) -> List[User]: def filter(self, query: List[User]) -> List[User]:
if self._id is not None: if self._id is not None:
query = query.where(lambda x: x.id == self._id) query = query.where(lambda x: x.user_id == self._id)
if self._discord_id is not None: if self._discord_id is not None:
query = query.where(lambda x: x.discord_id == self._discord_id) query = query.where(lambda x: x.discord_id == self._discord_id)

View File

@ -64,15 +64,15 @@ class GraphQLModule(ModuleABC):
services.add_transient(QueryABC, UserJoinedGameServerQuery) services.add_transient(QueryABC, UserJoinedGameServerQuery)
# filters # filters
services.add_singleton(FilterABC, AutoRoleFilter) services.add_transient(FilterABC, AutoRoleFilter)
services.add_singleton(FilterABC, AutoRoleRuleFilter) services.add_transient(FilterABC, AutoRoleRuleFilter)
services.add_singleton(FilterABC, ClientFilter) services.add_transient(FilterABC, ClientFilter)
services.add_singleton(FilterABC, LevelFilter) services.add_transient(FilterABC, LevelFilter)
services.add_singleton(FilterABC, ServerFilter) services.add_transient(FilterABC, ServerFilter)
services.add_singleton(FilterABC, UserFilter) services.add_transient(FilterABC, UserFilter)
services.add_singleton(FilterABC, UserJoinedServerFilter) services.add_transient(FilterABC, UserJoinedServerFilter)
services.add_singleton(FilterABC, UserJoinedVoiceChannelFilter) services.add_transient(FilterABC, UserJoinedVoiceChannelFilter)
services.add_singleton(FilterABC, UserJoinedGameServerFilter) services.add_transient(FilterABC, UserJoinedGameServerFilter)
# mutations # mutations
services.add_transient(QueryABC, AutoRoleMutation) services.add_transient(QueryABC, AutoRoleMutation)