🚨 Fixed DeepSource issues
This commit is contained in:
@@ -109,7 +109,7 @@ button_to_index_map = {"b": 0, "g": 1, "y": 2, "r": 3}
|
||||
@router.websocket("/socket/{id}")
|
||||
async def websocket_endpoint(ws: WebSocket, game_id: str, id: str):
|
||||
try:
|
||||
if id in wss_clients.keys():
|
||||
if id in wss_clients:
|
||||
await ws.close(code=status.WS_1001_GOING_AWAY)
|
||||
print("Client {} already exists.".format(id))
|
||||
return
|
||||
|
||||
@@ -26,7 +26,7 @@ def generate_code() -> str:
|
||||
"r",
|
||||
] # Capital stands for long press, lowercase letter for short press
|
||||
resulting_code = ""
|
||||
for i in range(specified_length):
|
||||
for _ in range(specified_length):
|
||||
resulting_code += random.choice(buttons)
|
||||
return resulting_code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user