Do not assume that the two_pages_field field is not None. Fixes #651

- Legacy-Id: 3063
This commit is contained in:
Emilio A. Sánchez López 2011-04-26 14:43:08 +00:00
parent 23d0ddf7e4
commit af039fba02

View file

@ -23,7 +23,7 @@ def show_two_pages(context, two_pages, validation):
@register.filter
def two_pages_decorated_with_validation(value, validation):
pages = value.first_two_pages
pages = value.first_two_pages or ''
if not 'revision' in validation.warnings.keys():
return mark_safe('<pre class="twopages" style="display: none;">%s</pre>' % pages)
result = '<pre class="twopages" style="display: none;">\n'