Merge pull request #1768 from annp89/feature/improve_exception_handling

Use model specific "DoesNotExist" exception
pull/1771/head
Karl Hobley 2015-10-03 09:53:11 +01:00
commit 6afc3a9ead
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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())