wcs: fix display of category cell in situation of blurp error (#7439)
This commit is contained in:
parent
b2168d8af0
commit
e4a9da041b
|
@ -267,7 +267,11 @@ class WcsFormsOfCategoryCell(WcsCommonCategoryCell, WcsBlurpMixin):
|
|||
context['slug'] = self.category_reference.split(':')[-1]
|
||||
context['title'] = self.cached_title
|
||||
context['description'] = self.cached_description
|
||||
context['forms'] = list(context['forms'][self.wcs_site]['data'])
|
||||
if 'forms' in context:
|
||||
context['forms'] = list(context['forms'][self.wcs_site]['data'])
|
||||
else:
|
||||
# an error occured in the blurp
|
||||
context['forms'] = []
|
||||
if self.ordering == 'alpha':
|
||||
context['forms'] = sorted(context['forms'], lambda x, y: cmp(x.get('title'), y.get('title')))
|
||||
elif self.ordering == 'popularity':
|
||||
|
|
Loading…
Reference in New Issue