wcs: only request formdef popularity when ordering by popularity (#21167)

This commit is contained in:
Frédéric Péters 2018-01-13 22:26:12 +01:00
parent 461ce4337c
commit 071946c627
1 changed files with 4 additions and 1 deletions

View File

@ -371,7 +371,10 @@ class WcsFormsOfCategoryCell(WcsCommonCategoryCell, WcsBlurpMixin):
@property
def api_url(self):
return '/api/categories/%s/formdefs/' % self.category_reference.split(':')[1]
api_url = '/api/categories/%s/formdefs/' % self.category_reference.split(':')[1]
if self.ordering == 'popularity':
api_url += '?include-count=on'
return api_url
def is_relevant(self, context):
return bool(self.category_reference)