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

@ -295,6 +295,7 @@ class Comment(Base):
return data
def award_count(self, kind):
if not FEATURES['AWARDS']: return 0
return len([x for x in self.awards if x.kind == kind])
@property