mirror of https://github.com/django/django.git
Fixed #21794 -- Removed deprecation warning for abstract models outside an app.
This commit is contained in:
parent
47b7f601ee
commit
e7b9a58b08
|
@ -100,13 +100,11 @@ class ModelBase(type):
|
||||||
msg = (
|
msg = (
|
||||||
"Model class %s.%s doesn't declare an explicit app_label "
|
"Model class %s.%s doesn't declare an explicit app_label "
|
||||||
"and either isn't in an application in INSTALLED_APPS or "
|
"and either isn't in an application in INSTALLED_APPS or "
|
||||||
"else was imported before its application was loaded. " %
|
"else was imported before its application was loaded. "
|
||||||
|
"This will no longer be supported in Django 1.9." %
|
||||||
(module, name))
|
(module, name))
|
||||||
if abstract:
|
if not abstract:
|
||||||
msg += "Its app_label will be set to None in Django 1.9."
|
warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2)
|
||||||
else:
|
|
||||||
msg += "This will no longer be supported in Django 1.9."
|
|
||||||
warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2)
|
|
||||||
|
|
||||||
model_module = sys.modules[new_class.__module__]
|
model_module = sys.modules[new_class.__module__]
|
||||||
package_components = model_module.__name__.split('.')
|
package_components = model_module.__name__.split('.')
|
||||||
|
|
Loading…
Reference in New Issue