user/submission/comment: avoid queries if awards are disabled
This commit is contained in:
parent
97c9300a6f
commit
026a9efe2b
5 changed files with 9 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue