diff --git a/django/core/apps.py b/django/core/apps.py index 0b4e6924ba..a70ad68b06 100644 --- a/django/core/apps.py +++ b/django/core/apps.py @@ -3,7 +3,8 @@ class App(object): if '.' in label: label = label.split('.')[-1] self.label = label - self.errors = {} + # errors raised when trying to import the app + self.errors = [] self.models = [] self.models_module = None diff --git a/django/db/models/loading.py b/django/db/models/loading.py index f4ccf7bffe..20ebba633b 100644 --- a/django/db/models/loading.py +++ b/django/db/models/loading.py @@ -29,9 +29,6 @@ class AppCache(object): # Mapping of app_labels to a dictionary of model names to model code. app_models = SortedDict(), - # Mapping of app_labels to errors raised when trying to import the app. - app_errors = {}, - # -- Everything below here is only used when populating the cache -- loaded = False, handled = {}, @@ -154,8 +151,10 @@ class AppCache(object): def get_app_errors(self): "Returns the map of known problems with the INSTALLED_APPS." self._populate() - for app in app_instances: - self.app_errors.update(app.errors) + errors = {} + for app in self.app_instances: + if app.errors: + errors.update({app.label: app.errors}) return errors def get_models(self, app_mod=None, include_auto_created=False, include_deferred=False):