mirror of https://github.com/django/django.git
Removed unused attribute app_errors of the app cache.
get_app_errors() always returned an empty dictionary; this behavior is preserved in django.db.models.loading until that module is deprecated.
This commit is contained in:
parent
0e9d3472d7
commit
2c9e84af4a
|
@ -35,9 +35,6 @@ def _initialize():
|
||||||
# May contain apps that are not installed.
|
# May contain apps that are not installed.
|
||||||
app_models=OrderedDict(),
|
app_models=OrderedDict(),
|
||||||
|
|
||||||
# Mapping of app_labels to errors raised when trying to import the app.
|
|
||||||
app_errors={},
|
|
||||||
|
|
||||||
# Pending lookups for lazy relations
|
# Pending lookups for lazy relations
|
||||||
pending_lookups={},
|
pending_lookups={},
|
||||||
|
|
||||||
|
@ -223,11 +220,6 @@ class BaseAppCache(object):
|
||||||
finally:
|
finally:
|
||||||
imp.release_lock()
|
imp.release_lock()
|
||||||
|
|
||||||
def get_app_errors(self):
|
|
||||||
"Returns the map of known problems with the INSTALLED_APPS."
|
|
||||||
self._populate()
|
|
||||||
return self.app_errors
|
|
||||||
|
|
||||||
def get_models(self, app_mod=None,
|
def get_models(self, app_mod=None,
|
||||||
include_auto_created=False, include_deferred=False,
|
include_auto_created=False, include_deferred=False,
|
||||||
only_installed=True, include_swapped=False):
|
only_installed=True, include_swapped=False):
|
||||||
|
|
|
@ -32,9 +32,6 @@ def get_validation_errors(outfile, app=None):
|
||||||
|
|
||||||
e = ModelErrorCollection(outfile)
|
e = ModelErrorCollection(outfile)
|
||||||
|
|
||||||
for (app_name, error) in app_cache.get_app_errors().items():
|
|
||||||
e.add(app_name, error)
|
|
||||||
|
|
||||||
for cls in app_cache.get_models(app, include_swapped=True):
|
for cls in app_cache.get_models(app, include_swapped=True):
|
||||||
opts = cls._meta
|
opts = cls._meta
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,19 @@ get_app_package = app_cache.get_app_package
|
||||||
get_app_path = app_cache.get_app_path
|
get_app_path = app_cache.get_app_path
|
||||||
get_app_paths = app_cache.get_app_paths
|
get_app_paths = app_cache.get_app_paths
|
||||||
get_app = app_cache.get_app
|
get_app = app_cache.get_app
|
||||||
get_app_errors = app_cache.get_app_errors
|
|
||||||
get_models = app_cache.get_models
|
get_models = app_cache.get_models
|
||||||
get_model = app_cache.get_model
|
get_model = app_cache.get_model
|
||||||
register_models = app_cache.register_models
|
register_models = app_cache.register_models
|
||||||
load_app = app_cache.load_app
|
load_app = app_cache.load_app
|
||||||
app_cache_ready = app_cache.app_cache_ready
|
app_cache_ready = app_cache.app_cache_ready
|
||||||
|
|
||||||
|
|
||||||
|
# This method doesn't return anything interesting in Django 1.6. Maintain it
|
||||||
|
# just for backwards compatibility until this module is deprecated.
|
||||||
|
def get_app_errors():
|
||||||
|
try:
|
||||||
|
return app_cache.app_errors
|
||||||
|
except AttributeError:
|
||||||
|
app_cache._populate()
|
||||||
|
app_cache.app_errors = {}
|
||||||
|
return app_cache.app_errors
|
||||||
|
|
Loading…
Reference in New Issue