mirror of
https://github.com/django/django.git
synced 2025-10-05 00:00:37 +00:00
Removed the app_config.installed flag.
Since applications that aren't installed no longer have an application configuration, it is now always True in practice. Provided an abstraction to temporarily add or remove applications as several tests messed with app_config.installed to achieve this effect. For now this API is _-prefixed because it looks dangerous.
This commit is contained in:
parent
972babc3b4
commit
9b3389b726
10 changed files with 99 additions and 60 deletions
|
@ -94,11 +94,11 @@ class Options(object):
|
|||
@property
|
||||
def app_config(self):
|
||||
# Don't go through get_app_config to avoid triggering populate().
|
||||
return self.app_cache.app_configs[self.app_label]
|
||||
return self.app_cache.app_configs.get(self.app_label)
|
||||
|
||||
@property
|
||||
def installed(self):
|
||||
return self.app_config.installed
|
||||
return self.app_config is not None
|
||||
|
||||
def contribute_to_class(self, cls, name):
|
||||
from django.db import connection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue