user/submission/comment: avoid queries if awards are disabled

This commit is contained in:
justcool393 2023-02-08 17:54:12 -06:00
parent 97c9300a6f
commit 026a9efe2b
5 changed files with 9 additions and 3 deletions

View file

@ -376,7 +376,7 @@ class User(Base):
@property
@lazy
def received_awards(self):
if not FEATURES['AWARDS']: return []
awards = {}
posts_idlist = [x[0] for x in g.db.query(Submission.id).filter_by(author_id=self.id).all()]