Explorar o código

Merge pull request #459 from adworacz/better_responsive

Better Images: Prevent errors when RESPONIVE_IMAGES is not set.
Justin Mayer %!s(int64=10) %!d(string=hai) anos
pai
achega
06b2cfd086
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      better_figures_and_images/better_figures_and_images.py

+ 1 - 1
better_figures_and_images/better_figures_and_images.py

@@ -59,7 +59,7 @@ def content_object_init(instance):
                 im = Image.open(src)
                 extra_style = 'width: {}px; height: auto;'.format(im.size[0])
 
-                if instance.settings['RESPONSIVE_IMAGES']:
+                if 'RESPONSIVE_IMAGES' in instance.settings and instance.settings['RESPONSIVE_IMAGES']:
                     extra_style += ' max-width: 100%;'
 
                 if img.get('style'):