fdfd
This commit is contained in:
parent
7e6f95a5af
commit
ad31b88d73
2 changed files with 16 additions and 6 deletions
|
@ -423,15 +423,13 @@ class User(Base, Stndrd, Age_times):
|
|||
User.id != self.id
|
||||
).order_by(User.username.asc()).all()
|
||||
|
||||
data = [x for x in data]
|
||||
output = []
|
||||
for x in data:
|
||||
user = x[0]
|
||||
user._is_manual = x[1].is_manual
|
||||
output.append(user)
|
||||
|
||||
for alt in output:
|
||||
output += alt.alts
|
||||
|
||||
return output
|
||||
|
||||
def alts_threaded(self, db):
|
||||
|
|
|
@ -40,10 +40,22 @@ 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()
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue