From 53083395daac6e29f3feaeaf949cae0dd3d01648 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 23 Aug 2021 21:08:34 +0200 Subject: [PATCH] gfgf --- files/classes/user.py | 3 ++- files/routes/login.py | 16 +++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 6da1fe0fcf..3df8ac1060 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -423,7 +423,8 @@ class User(Base, Stndrd, Age_times): User.id != self.id ).order_by(User.username.asc()).all() - data = [x for x in data] + for alt in data: + data += alt.data output = [] for x in data: user = x[0] diff --git a/files/routes/login.py b/files/routes/login.py index 6591eb033d..bcd1f2e56a 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -40,20 +40,10 @@ def check_for_alts(current_id): if not check1 and not check2: try: - new_alt = Alt(user1=past_id, user2=current_id) + new_alt = Alt(user1=past_id, + user2=current_id) g.db.add(new_alt) - otheralts = g.db.query(Alt).filter(or_(Alt.user1 == past_id, Alt.user2 == past_id, Alt.user1 == current_id, Alt.user2 == current_id)).all() - for a in otheralts: - try: - new_alt = Alt(user1=a.user1, user2=past_id) - g.db.add(new_alt) - g.db.flush() - new_alt = Alt(user1=a.user1, user2=current_id) - g.db.add(new_alt) - g.db.flush() - except: - g.db.rollback() - continue + except BaseException: pass