forked from MarseyWorld/MarseyWorld
master
parent
6e80814a88
commit
9b8f4a4e42
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue