Skip to content
Snippets Groups Projects
Commit 910f254c authored by Jan Hartig's avatar Jan Hartig
Browse files

Capitalize random room & fix error response

See merge request !26
parents 8d552602 f31028aa
No related branches found
No related tags found
1 merge request!26Dev
Pipeline #30197 passed
...@@ -47,7 +47,7 @@ async def unlock_room(request: Request): ...@@ -47,7 +47,7 @@ async def unlock_room(request: Request):
if room.lower() == entry["room"].lower(): if room.lower() == entry["room"].lower():
return json_response({"error": "Raum nicht freischaltbar."}) return json_response({"error": "Raum nicht freischaltbar."})
except KeyError: except (KeyError, TypeError):
room = get_random_room() room = get_random_room()
# Make room name url-safe # Make room name url-safe
...@@ -110,7 +110,7 @@ def check_auth(request: Request) -> dict: ...@@ -110,7 +110,7 @@ def check_auth(request: Request) -> dict:
def get_random_room() -> str: def get_random_room() -> str:
return f"{r.word(include_parts_of_speech=['adjectives'])}{r.word(include_parts_of_speech=['nouns'])}" return f"{r.word(include_parts_of_speech=['adjectives']).capitalize()}{r.word(include_parts_of_speech=['nouns']).capitalize()}"
async def get_serial2room(): async def get_serial2room():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment