aboutsummaryrefslogtreecommitdiff
path: root/api/user/info.py
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-09 18:28:04 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-09 18:28:04 +0100
commit57b098efd90b72c854582de9d7dafdc40506d5a9 (patch)
treeb2d6028c509ff077a5f5a58ed35b569bde19a76c /api/user/info.py
parent01b571735cb371942d4ee997f94c5ccb98265c39 (diff)
user page :tada:
Diffstat (limited to 'api/user/info.py')
-rw-r--r--api/user/info.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/api/user/info.py b/api/user/info.py
index 3d4f4fb..954a989 100644
--- a/api/user/info.py
+++ b/api/user/info.py
@@ -30,12 +30,12 @@ def index():
not token:
return "", 400
- if token:
+ if token and not (username or user_id):
user_id = token_login(token)
- elif username:
+
+ if username and not user_id:
temp_user_id = cursor.execute("select user_id from users where username = ?", [username]).fetchone()
- if temp_user_id:
- user_id = temp_user_id[0]
+ if len(temp_user_id) > 0: user_id = temp_user_id
user = format_user(user_id)