summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-22 17:07:18 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-22 17:07:18 +0100
commit4f064c2f0511dc900c7f4a736573c309de84dec7 (patch)
tree3b41a55e478669d3e6166e722d92c2f71859c2c0
parentba60fcbcf7645afd82f3135ecb56562f8a9c9824 (diff)
Changed has_app to return a boolean.
That matches its name ad its purpose better.
-rw-r--r--django/apps/cache.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/apps/cache.py b/django/apps/cache.py
index 056aa9a60b..e7adffecdb 100644
--- a/django/apps/cache.py
+++ b/django/apps/cache.py
@@ -300,15 +300,15 @@ class AppCache(object):
def has_app(self, app_name):
"""
- Returns the application config if one is registered and None otherwise.
+ Checks whether an application with this name exists in the app cache.
+
+ app_name is the full name of the app eg. 'django.contrib.admin'.
It's safe to call this method at import time, even while the app cache
is being populated. It returns None for apps that aren't loaded yet.
"""
app_config = self.app_configs.get(app_name.rpartition(".")[2])
- if app_config is not None and app_config.name != app_name:
- app_config = None
- return app_config
+ return app_config is not None and app_config.name == app_name:
def has_model(self, app_label, model_name):
"""