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
|
@ -336,6 +336,7 @@ class Submission(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])
|
||||
|
||||
@lazy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue