diff options
Diffstat (limited to 'api/randid.py')
-rw-r--r-- | api/randid.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/randid.py b/api/randid.py index a6ff11f..b9292b6 100644 --- a/api/randid.py +++ b/api/randid.py @@ -3,8 +3,8 @@ import uuid def new_uuid(): temp_uuid = str(uuid.uuid4()) - query = cursor.execute("select user_id from users where user_id = \"{temp_uuid}\"").fetchone() - if query: + # check if user_id is already taken + if cursor.execute("select user_id from users where user_id = ?", [temp_uuid]).fetchone(): return new_uuid() else: return temp_uuid |