diff --git a/apps/grouping/forms.py b/apps/grouping/forms.py index 1fa96b3ab9..389987ab7a 100644 --- a/apps/grouping/forms.py +++ b/apps/grouping/forms.py @@ -30,8 +30,9 @@ class DocumentGroupImageWidget(forms.widgets.Widget): for document in value['group_data']: tags_template = get_tags_inline_widget(document) - output.append( - u'''
+ try: + document.get_valid_image() + template = u'''
%(document_name)s
%(page_string)s: %(document_pages)d
%(tags_template)s @@ -46,7 +47,24 @@ class DocumentGroupImageWidget(forms.widgets.Widget): -
''' % { +
''' + except: + template = u'''
+
%(document_name)s
+
%(page_string)s: %(document_pages)d
+ %(tags_template)s +
+ %(string)s + +
+
+ %(details_string)s +
+
''' + + output.append(template % { 'url': reverse('document_view_simple', args=[document.pk]), 'img': reverse('document_preview_multipage', args=[document.pk]), 'current': u'border: 5px solid black; padding: 3px;' if value['current_document'] == document else u'',