Skip to content

Commit

Permalink
refactor: code refactoring #504
Browse files Browse the repository at this point in the history
  • Loading branch information
LWJ0513 committed Mar 31, 2024
1 parent 892d874 commit d3313a3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions backend/games/consumers/GameConsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,12 @@ async def _get_my_match_PingPongGame_object(self, game_group_name, my_match):
return getattr(self.GameList, f'{game_group_name}_match{my_match}')

async def _get_my_match_group_name(self, my_match):
group_name = None
if my_match == 1:
group_name = self.match1_group_name
elif my_match == 2:
group_name = self.match2_group_name
elif my_match == 3:
group_name = self.match3_group_name
return group_name
group_name_options = {
1: self.match1_group_name,
2: self.match2_group_name,
3: self.match3_group_name,
}
return group_name_options.get(my_match)

@database_sync_to_async
def _get_serializer_data(self, final):
Expand Down

0 comments on commit d3313a3

Please sign in to comment.