aboutsummaryrefslogtreecommitdiff
path: root/api/randid.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/randid.py')
-rw-r--r--api/randid.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/api/randid.py b/api/randid.py
new file mode 100644
index 0000000..a6ff11f
--- /dev/null
+++ b/api/randid.py
@@ -0,0 +1,11 @@
+from main import cursor
+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:
+ return new_uuid()
+ else:
+ return temp_uuid
+