forked from Formulka/django-fperms-iscore
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
106 additions
and
15 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
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.conf import settings as django_settings | ||
|
||
|
||
DEFAULTS = { | ||
'IS_CORE_PERM_USE_CACHE': False, | ||
'IS_CORE_PERM_CACHE_NAME': 'default', | ||
'IS_CORE_PERM_CACHE_TIMEOUT': 60 * 10, # 10 min | ||
} | ||
|
||
|
||
class Settings: | ||
|
||
def __getattr__(self, attr): | ||
if attr not in DEFAULTS: | ||
raise AttributeError('Invalid fperms_iscore setting: "{}"'.format(attr)) | ||
|
||
default = DEFAULTS[attr] | ||
return getattr(django_settings, attr, default(self) if callable(default) else default) | ||
|
||
|
||
settings = Settings() |
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