From 5b2ec04f244a112403847dd852256cf959d7bf42 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 23 Aug 2021 21:12:14 +0200 Subject: [PATCH] dfdf --- files/routes/login.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/files/routes/login.py b/files/routes/login.py index 6c45b2458..4cd95e7fb 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -42,23 +42,24 @@ def check_for_alts(current_id): try: 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() - print(otheralts) - 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 Exception as e: - g.db.rollback() - print(e) - continue except BaseException: pass + otheralts = g.db.query(Alt).filter(or_(Alt.user1 == past_id, Alt.user2 == past_id, Alt.user1 == current_id, Alt.user2 == current_id)).all() + print(otheralts) + 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 Exception as e: + g.db.rollback() + print(e) + continue + # login post procedure