Provide default value to ALLOWED_RESOURCES.
This commit is contained in:
parent
c68aec5dc3
commit
1d5d3a5ed3
|
@ -1,3 +1,4 @@
|
||||||
|
from collections import defaultdict
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,10 +6,15 @@ def getsetting(name):
|
||||||
value = getattr(settings, name, None)
|
value = getattr(settings, name, None)
|
||||||
return value or DEFAULTS.get(name)
|
return value or DEFAULTS.get(name)
|
||||||
|
|
||||||
|
# provide a default value allowing to overwrite it for each type of account
|
||||||
|
def allowed_resources_default_factory():
|
||||||
|
return {'mailbox': 2}
|
||||||
|
|
||||||
DEFAULTS = {
|
DEFAULTS = {
|
||||||
# allowed resources limit hardcoded because cannot be retrieved from the API.
|
# allowed resources limit hardcoded because cannot be retrieved from the API.
|
||||||
"ALLOWED_RESOURCES": {
|
"ALLOWED_RESOURCES": defaultdict(
|
||||||
|
allowed_resources_default_factory,
|
||||||
|
{
|
||||||
'INDIVIDUAL':
|
'INDIVIDUAL':
|
||||||
{
|
{
|
||||||
# 'disk': 1024,
|
# 'disk': 1024,
|
||||||
|
@ -20,7 +26,8 @@ DEFAULTS = {
|
||||||
# 'traffic': 20 * 1024,
|
# 'traffic': 20 * 1024,
|
||||||
'mailbox': 10,
|
'mailbox': 10,
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
),
|
||||||
"URL_DB_PHPMYADMIN": "https://phpmyadmin.pangea.org/",
|
"URL_DB_PHPMYADMIN": "https://phpmyadmin.pangea.org/",
|
||||||
"URL_MAILTRAIN": "https://mailtrain.org/",
|
"URL_MAILTRAIN": "https://mailtrain.org/",
|
||||||
"URL_SAAS_GITLAB": "https://gitlab.pangea.org/",
|
"URL_SAAS_GITLAB": "https://gitlab.pangea.org/",
|
||||||
|
|
Loading…
Reference in New Issue