dfdf
This commit is contained in:
parent
ad31b88d73
commit
5b2ec04f24
1 changed files with 15 additions and 14 deletions
|
@ -42,23 +42,24 @@ def check_for_alts(current_id):
|
||||||
try:
|
try:
|
||||||
new_alt = Alt(user1=past_id, user2=current_id)
|
new_alt = Alt(user1=past_id, user2=current_id)
|
||||||
g.db.add(new_alt)
|
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:
|
except BaseException:
|
||||||
pass
|
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
|
# login post procedure
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue