From 616b0397355d6699e6c20b75c511f4c81c549a8d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 7 Nov 2021 22:34:12 +0200 Subject: [PATCH] dsf --- files/classes/user.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 66bb3da4e..a5b4a2335 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1,4 +1,4 @@ -from sqlalchemy.orm import deferred +from sqlalchemy.orm import deferred, aliased from secrets import token_hex import pyotp from files.helpers.discord import remove_user @@ -372,12 +372,12 @@ class User(Base): data = g.db.query( User, - Alt + aliased(Alt, alias=subq) ).join( subq, or_( - Alt.c.user1 == User.id, - Alt.c.user2 == User.id + subq.c.user1 == User.id, + subq.c.user2 == User.id ) ).filter( User.id != self.id