-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: manage settings in SecObserve UI (#1413)
* feat: manage settings in SecObserve UI * chore: unittests and code quality * chore: code quality
- Loading branch information
Showing
75 changed files
with
1,542 additions
and
423 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
from django.utils.functional import LazyObject | ||
|
||
|
||
class LazyConfig(LazyObject): | ||
def _setup(self): | ||
from application.commons.models import ( # pylint: disable=import-outside-toplevel | ||
Settings, | ||
) | ||
|
||
# Can't be imported because module wouldn't be ready | ||
|
||
self._wrapped = Settings.load() | ||
|
||
|
||
if TYPE_CHECKING: | ||
from application.commons.models import Settings | ||
settings_static: "Settings" = LazyConfig() # type: ignore [assignment] | ||
# LazyObject wraps the Settings model and returns the instance of the model when accessed. |
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
Oops, something went wrong.