forked from rDrama/rDrama
partially revert a94dda90dd
. restore some commits that turned out to be necessary
parent
a57ff00e09
commit
2f8fec6fff
|
@ -118,6 +118,7 @@ def _sub_inactive_purge_task():
|
||||||
|
|
||||||
for x in to_delete:
|
for x in to_delete:
|
||||||
g.db.delete(x)
|
g.db.delete(x)
|
||||||
|
g.db.flush() #Necessary, following deletion errors out otherwise
|
||||||
|
|
||||||
for x in dead_holes:
|
for x in dead_holes:
|
||||||
g.db.delete(x)
|
g.db.delete(x)
|
||||||
|
|
|
@ -321,6 +321,8 @@ def sign_up_post(v:Optional[User]):
|
||||||
|
|
||||||
g.db.add(new_user)
|
g.db.add(new_user)
|
||||||
|
|
||||||
|
g.db.flush()
|
||||||
|
|
||||||
if ref_id:
|
if ref_id:
|
||||||
ref_user = get_account(ref_id)
|
ref_user = get_account(ref_id)
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ def add_alt(user1:int, user2:int):
|
||||||
if not existing:
|
if not existing:
|
||||||
new_alt = Alt(user1=user1, user2=user2)
|
new_alt = Alt(user1=user1, user2=user2)
|
||||||
g.db.add(new_alt)
|
g.db.add(new_alt)
|
||||||
|
g.db.flush()
|
||||||
cache.delete_memoized(get_alt_graph_ids, user1)
|
cache.delete_memoized(get_alt_graph_ids, user1)
|
||||||
cache.delete_memoized(get_alt_graph_ids, user2)
|
cache.delete_memoized(get_alt_graph_ids, user2)
|
||||||
|
|
||||||
|
@ -79,7 +80,7 @@ def check_for_alts(current:User, include_current_session=False):
|
||||||
past_accs.add(current_id)
|
past_accs.add(current_id)
|
||||||
if include_current_session:
|
if include_current_session:
|
||||||
session["history"] = list(past_accs)
|
session["history"] = list(past_accs)
|
||||||
|
g.db.flush()
|
||||||
for u in get_alt_graph(current.id):
|
for u in get_alt_graph(current.id):
|
||||||
if u.shadowbanned and not current.shadowbanned:
|
if u.shadowbanned and not current.shadowbanned:
|
||||||
current.shadowbanned = u.shadowbanned
|
current.shadowbanned = u.shadowbanned
|
||||||
|
|
|
@ -388,6 +388,7 @@ def create_sub2(v):
|
||||||
|
|
||||||
sub = Sub(name=name)
|
sub = Sub(name=name)
|
||||||
g.db.add(sub)
|
g.db.add(sub)
|
||||||
|
g.db.flush() #Necessary, following statement errors out otherwise
|
||||||
mod = Mod(user_id=v.id, sub=sub.name)
|
mod = Mod(user_id=v.id, sub=sub.name)
|
||||||
g.db.add(mod)
|
g.db.add(mod)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue