0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00

Use model specific "DoesNotExist" exception than generic "ObjectDoesNotExist" exception

This commit is contained in:
Ann Paul 2015-10-02 22:48:15 -07:00
parent e955f7da4c
commit 3b8111f224

View File

@ -10,7 +10,7 @@ from taggit.managers import TaggableManager
from willow.image import Image as WillowImage
from django.core.files import File
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.dispatch.dispatcher import receiver
@ -223,7 +223,7 @@ class AbstractImage(models.Model, TagSearchable):
filter=filter,
focal_point_key=cache_key,
)
except ObjectDoesNotExist:
except Rendition.DoesNotExist:
# Generate the rendition image
generated_image, output_format = filter.run(self, BytesIO())