-
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Provides backwards compatibility through conf adapters that determine which settings are supported and where the data can be loaded from. This implementation adds 3: * LegacyConfig - supports the existing settings format * AppConfig - supports a dictionary of application_ids and their settings * AppModelConfig - supports storing the settings in the database for multiple apps
- Loading branch information
1 parent
dcbd63a
commit a6bc509
Showing
20 changed files
with
1,128 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.utils.module_loading import import_string | ||
from .app import AppConfig # noqa: F401 | ||
from .appmodel import AppModelConfig # noqa: F401 | ||
from .legacy import LegacyConfig # noqa: F401 | ||
from ..settings import PUSH_NOTIFICATIONS_SETTINGS as SETTINGS | ||
|
||
|
||
manager = None | ||
|
||
|
||
def get_manager(reload=False): | ||
global manager | ||
|
||
if not manager or reload is True: | ||
manager = import_string(SETTINGS["CONFIG"])() | ||
|
||
return manager | ||
|
||
|
||
# implementing get_manager as a function allows tests to reload settings | ||
get_manager() |
Oops, something went wrong.