Skip to content

Commit dbfe93f

Browse files
committed
rm oserr
1 parent 2f0b67f commit dbfe93f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/sponsors/templatetags/sponsors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def ideal_size(image, ideal_dimension):
8383
ideal_dimension = int(ideal_dimension)
8484
try:
8585
w, h = image.width, image.height
86-
except (FileNotFoundError, OSError):
87-
# FileNotFoundError: local dev doesn't have all images
88-
# OSError (includes PIL.UnidentifiedImageError): SVG/EPS can't be read by PIL
86+
except FileNotFoundError:
87+
# local dev doesn't have all images if DB is a copy from prod environment
88+
# this is just a fallback to return ideal_dimension instead
8989
w, h = ideal_dimension, ideal_dimension
9090

9191
return int(w * math.sqrt((100 * ideal_dimension) / (w * h)))

0 commit comments

Comments
 (0)