remotes/1693045480750635534/spooky-22
Aevann1 2021-08-23 21:10:49 +02:00
parent 70b9d52db7
commit 33b1b1288b
2 changed files with 16 additions and 6 deletions

View File

@ -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):

View File

@ -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