master
Aevann1 2021-09-05 19:47:15 +02:00
parent 6e80814a88
commit 9b8f4a4e42
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ IMGUR_KEY = environ.get("IMGUR_KEY", "").strip()
@admin_level_required(6)
def received_awards(v):
for u in g.db.query(User).options(lazyload('*')).all():
posts_idlist = g.db.query(Submission.id).filter_by(author_id=self.id).subquery()
comments_idlist = g.db.query(Comment.id).filter_by(author_id=self.id).subquery()
posts_idlist = g.db.query(Submission.id).filter_by(author_id=u.id).subquery()
comments_idlist = g.db.query(Comment.id).filter_by(author_id=u.id).subquery()
post_awards = g.db.query(AwardRelationship).filter(AwardRelationship.submission_id.in_(posts_idlist)).count()
comment_awards = g.db.query(AwardRelationship).filter(AwardRelationship.comment_id.in_(comments_idlist)).count()