aboutsummaryrefslogtreecommitdiff
path: root/api/valid.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/valid.py')
-rw-r--r--api/valid.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/api/valid.py b/api/valid.py
index f407460..1c63703 100644
--- a/api/valid.py
+++ b/api/valid.py
@@ -2,20 +2,20 @@ from db import cursor
def validate(id, type):
- types = {
- "user": ["user_id", "users"],
- "game": ["game_id", "games"],
- }
- fields = types[type]
- query = cursor.execute(
- f"select {fields[0]} from {fields[1]} where {fields[0]} = ?", [id]
- ).fetchone()
- return bool(query)
+ types = {
+ "user": ["user_id", "users"],
+ "game": ["game_id", "games"],
+ }
+ fields = types[type]
+ query = cursor.execute(
+ f"select {fields[0]} from {fields[1]} where {fields[0]} = ?", [id]
+ ).fetchone()
+ return bool(query)
def user_id(user_id):
- return validate(user_id, "user")
+ return validate(user_id, "user")
def game_id(game_id):
- return validate(game_id, "game")
+ return validate(game_id, "game")