summaryrefslogtreecommitdiff
path: root/db_actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'db_actions.py')
-rw-r--r--db_actions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/db_actions.py b/db_actions.py
index 26f69df..fca9ab0 100644
--- a/db_actions.py
+++ b/db_actions.py
@@ -21,7 +21,8 @@ def user_get_nick(id):
sql = "SELECT nick \
FROM users \
WHERE id=(:id);"
- return db.session.execute(text(sql), { "id":id }).fetchone()[0]
+ result = db.session.execute(text(sql), { "id":id }).fetchone()
+ return result[0] if result else result
def user_exists(nick):
sql = "SELECT COUNT(id) \