wpd cant handle the alt graph

master
Aevann 2024-10-28 23:03:02 +03:00
parent 1c531c56b1
commit c6a7080776
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ def validate_formkey(u, formkey):
@cache.memoize(timeout=86400)
def get_alt_graph_ids(uid):
if SITE_NAME == 'WPD':
alts = g.db.query(Alt.user1).filter_by(user2=uid).all() + g.db.query(Alt.user2).filter_by(user1=uid).all()
return {x[0] for x in alts}
alt_graph_cte = g.db.query(literal(uid).label('user_id')).select_from(Alt).cte('alt_graph', recursive=True)
alt_graph_cte_inner = g.db.query(