From bb39f268d3192bb738eee510384731ad20a17939 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 2 Jun 2024 12:48:06 +0100 Subject: [PATCH] Fix potential issue with existing user query matching multiple users --- app/blueprints/github/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/blueprints/github/__init__.py b/app/blueprints/github/__init__.py index 912bb2fc..d81837a4 100644 --- a/app/blueprints/github/__init__.py +++ b/app/blueprints/github/__init__.py @@ -105,7 +105,7 @@ def callback(oauth_token): else: existing_user = (User.query .filter(or_(User.username == github_username, User.forums_username == github_username)) - .one_or_none()) + .first()) if existing_user: flash(gettext("Unable to create an account as the username is already taken. " "If you meant to log in, you need to connect GitHub to your account first"), "danger")