From ff94cc57a3de011ccf86e19ad73c7344f1707a18 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Wed, 2 Nov 2016 12:51:49 +0100 Subject: [PATCH] Only show image size if it's image Otherwise it'd be NonexNone --- pillar/web/utils/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pillar/web/utils/forms.py b/pillar/web/utils/forms.py index 94debb3f..4325a4c2 100644 --- a/pillar/web/utils/forms.py +++ b/pillar/web/utils/forms.py @@ -57,8 +57,9 @@ class CustomFileSelectWidget(HiddenInput): button.append(u'
  • ({0} MB)
  • '.format( round((file_item.length / 1024) * 0.001, 2))) # Image resolution (if image) - button.append(u'
  • {0}x{1}
  • '.format( - file_item.width, file_item.height)) + if file_item.content_type.split('/')[0] == 'image': + button.append(u'
  • {0}x{1}
  • '.format( + file_item.width, file_item.height)) # Delete button button.append(u'
  • ' u'