Skip to content

Commit

Permalink
Use loading module directly
Browse files Browse the repository at this point in the history
  • Loading branch information
macro1 committed Oct 31, 2014
1 parent 9164eff commit ce29aa8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
except ImportError:
apps = None
from django.db import models, router
from django.db.models import loading
from django.db.models.fields.related import RelatedField
from django.db.models.related import RelatedObject
from django.conf import settings
Expand Down Expand Up @@ -99,7 +100,7 @@ def create_history_model(self, model):
elif app_module != self.module:
if apps is None:
# has meta options with app_label
app = models.get_app(model._meta.app_label)
app = loading.get_app(model._meta.app_label)
attrs['__module__'] = app.__name__ # full dotted name
else:
# Abuse an internal API because the app registry is loading.
Expand Down

0 comments on commit ce29aa8

Please sign in to comment.