wcs: fix display of category cell in situation of blurp error (#7439)

This commit is contained in:
Frédéric Péters 2015-06-06 16:19:11 +02:00
parent b2168d8af0
commit e4a9da041b
1 changed files with 5 additions and 1 deletions

View File

@ -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':