mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-05-19 18:01:53 +00:00
Fields shouldn't cause AlreadyRegistered exceptions
This commit is contained in:
parent
091b2137d0
commit
6f9f99e86c
1 changed files with 10 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ from hashlib import md5
|
|||
import pickle
|
||||
from ..cachefiles.backends import get_default_cachefile_backend
|
||||
from ..cachefiles.strategies import StrategyWrapper
|
||||
from ..exceptions import MissingSource
|
||||
from ..exceptions import AlreadyRegistered, MissingSource
|
||||
from ..processors import ProcessorPipeline
|
||||
from ..utils import open_image, img_to_fobj, get_by_qname
|
||||
from ..registry import generator_registry, register
|
||||
|
|
@ -204,7 +204,15 @@ class SpecHost(object):
|
|||
self.spec_id = id
|
||||
|
||||
if self._original_spec:
|
||||
register.generator(id, self._original_spec)
|
||||
try:
|
||||
register.generator(id, self._original_spec)
|
||||
except AlreadyRegistered:
|
||||
# Fields should not cause AlreadyRegistered exceptions. If a
|
||||
# spec is already registered, that should be used. It is
|
||||
# especially important that an error is not thrown here because
|
||||
# of South, which will create duplicate models as part of its
|
||||
# "fake orm," therefore re-registering specs.
|
||||
pass
|
||||
|
||||
def get_spec(self, source):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue