This commit is contained in:
Aevann1 2021-10-27 22:40:05 +02:00
parent 5d2f5a037d
commit 4a2c67ab2d
3 changed files with 9 additions and 5 deletions

View file

@ -26,8 +26,9 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
def justice(v):
for id in [261,1832,1833]:
u = g.db.query(User).options(lazyload('*')).filter_by(id = id).first()
u.comment_count = g.db.query(Comment).options(lazyload('*')).filter_by(author_id = id).count()
g.db.add(u)
if u:
u.comment_count = g.db.query(Comment).options(lazyload('*')).filter_by(author_id = id).count()
g.db.add(u)
g.db.commit()
return "sex"