From acbb7ff3a99fb04e912f2e9b641a04d75900ff04 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sat, 15 Apr 2017 07:54:57 +0000 Subject: [PATCH] Quick fix to prevent really long discriminators for unauthenticated users --- titanembeds/blueprints/api/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/titanembeds/blueprints/api/api.py b/titanembeds/blueprints/api/api.py index 7e840ad..554b678 100644 --- a/titanembeds/blueprints/api/api.py +++ b/titanembeds/blueprints/api/api.py @@ -317,7 +317,7 @@ def create_unauthenticated_user(): abort(401) if not checkUserBanned(guild_id, ip_address): session['username'] = username - if 'user_id' not in session: + if 'user_id' not in session or len(str(session["user_id"])) > 4: session['user_id'] = random.randint(0,9999) user = UnauthenticatedUsers(guild_id, username, session['user_id'], ip_address) db.session.add(user)