diff options
| author | Carl Meyer <carl@oddbird.net> | 2014-11-19 15:56:04 -0700 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2014-11-19 15:56:25 -0700 |
| commit | ac359dc7710ed8c62b6f058fe5a0ecfd6ce27602 (patch) | |
| tree | 8baf65aff5c208bedbcf615668a27615a8a71180 | |
| parent | 50434aebe2d3307263ca55f6dd9fa7ace2f87d8f (diff) | |
[1.7.x] Fixed #21794 -- Removed deprecation warning for abstract models outside an app.
Backport of e7b9a58b081299b30f807d5c66f7a5d1940efe4c from master.
| -rw-r--r-- | django/db/models/base.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index c04e53eac9..e802dd955d 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -98,13 +98,11 @@ class ModelBase(type): msg = ( "Model class %s.%s doesn't declare an explicit app_label " "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)) - if abstract: - msg += "Its app_label will be set to None in Django 1.9." - else: - msg += "This will no longer be supported in Django 1.9." - warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2) + if not abstract: + warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2) model_module = sys.modules[new_class.__module__] package_components = model_module.__name__.split('.') |
