magic-removal: Fixed #1413 -- Fixed error message when a model isn't in INSTALLED_APPS. Thanks, akaihola
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2438 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4b0acfc202
commit
bd5a98c93f
|
@ -28,7 +28,7 @@ class ModelBase(type):
|
|||
|
||||
# Raise ImportError if this model isn't in INSTALLED_APPS.
|
||||
if re.sub('\.models$', '', mod) not in settings.INSTALLED_APPS:
|
||||
raise ImportError, "INSTALLED_APPS must contain %r in order for you to use this model." % mod
|
||||
raise ImportError, "INSTALLED_APPS must contain %r in order for you to use this model." % re.sub('\.models$', '', mod)
|
||||
|
||||
# Create the class.
|
||||
new_class = type.__new__(cls, name, bases, {'__module__': mod})
|
||||
|
|
Loading…
Reference in New Issue