Switched from using django.db.models.loading.get_model to using django.apps.apps.get_model

This commit is contained in:
Brent O'Connor 2016-02-10 16:28:40 -06:00
parent 02d6b984ca
commit 337cca5813

View file

@ -119,10 +119,10 @@ def _process_registry(registry, call_func):
Given a dictionary, and a registration function, process the registry
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from django.apps import apps
for key, value in list(registry.items()):
model = get_model(*key.split('.'))
model = apps.get_model(*key.split('.'))
if model is None:
raise ImproperlyConfigured(_('%(key)s is not a model') % {'key': key})
if isinstance(value, (tuple, list)):