1
0
mirror of https://github.com/django/django.git synced 2025-07-19 09:09:13 +00:00

[1.9.x] Fixed #25984 -- Corrected RuntimeError message in ModelBase.__new__().

Backport of 692d05589061a593d4bfbdb2895eaef0386eca34 from master
This commit is contained in:
Varun Sharma 2015-12-24 23:58:32 +05:30 committed by Tim Graham
parent 85159b9819
commit dc1ef0ff2e
2 changed files with 4 additions and 5 deletions

View File

@ -98,9 +98,9 @@ class ModelBase(type):
if not abstract: if not abstract:
raise RuntimeError( raise RuntimeError(
"Model class %s.%s doesn't declare an explicit " "Model class %s.%s doesn't declare an explicit "
"app_label and either isn't in an application in " "app_label and isn't in an application in "
"INSTALLED_APPS or else was imported before its " "INSTALLED_APPS." % (module, name)
"application was loaded. " % (module, name)) )
else: else:
app_label = app_config.label app_label = app_config.label

View File

@ -76,8 +76,7 @@ ALWAYS_MIDDLEWARE_CLASSES = [
# Need to add the associated contrib app to INSTALLED_APPS in some cases to # Need to add the associated contrib app to INSTALLED_APPS in some cases to
# avoid "RuntimeError: Model class X doesn't declare an explicit app_label # avoid "RuntimeError: Model class X doesn't declare an explicit app_label
# and either isn't in an application in INSTALLED_APPS or else was imported # and isn't in an application in INSTALLED_APPS."
# before its application was loaded."
CONTRIB_TESTS_TO_APPS = { CONTRIB_TESTS_TO_APPS = {
'flatpages_tests': 'django.contrib.flatpages', 'flatpages_tests': 'django.contrib.flatpages',
'redirects_tests': 'django.contrib.redirects', 'redirects_tests': 'django.contrib.redirects',