Skip to content

Commit

Permalink
fix error due to factory test file
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Oct 6, 2023
1 parent 3bfead5 commit 4f2d90a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion geotrek/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.utils.translation import gettext_lazy as _
from drf_dynamic_fields import DynamicFieldsMixin
from easy_thumbnails.alias import aliases
from easy_thumbnails.engine import NoSourceGenerator
from easy_thumbnails.exceptions import InvalidImageFormatError
from easy_thumbnails.files import get_thumbnailer
from PIL.Image import DecompressionBombError
Expand Down Expand Up @@ -261,7 +262,7 @@ def get_thumbnail(self, obj):
thumbnailer = get_thumbnailer(self.get_attachment_file(obj))
try:
thumbnail = thumbnailer.get_thumbnail(aliases.get('apiv2'))
except (IOError, InvalidImageFormatError, DecompressionBombError):
except (IOError, InvalidImageFormatError, DecompressionBombError, NoSourceGenerator):
return ""
thumbnail.author = obj.author
thumbnail.legend = obj.legend
Expand Down

0 comments on commit 4f2d90a

Please sign in to comment.