2020-04-02 06:15:36 +00:00
|
|
|
from collections import defaultdict
|
2020-01-22 11:53:12 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
|
|
|
|
def getsetting(name):
|
2020-01-23 15:32:36 +00:00
|
|
|
value = getattr(settings, name, None)
|
|
|
|
return value or DEFAULTS.get(name)
|
2020-01-22 11:53:12 +00:00
|
|
|
|
2020-04-02 06:15:36 +00:00
|
|
|
# provide a default value allowing to overwrite it for each type of account
|
|
|
|
def allowed_resources_default_factory():
|
|
|
|
return {'mailbox': 2}
|
2020-01-22 11:53:12 +00:00
|
|
|
|
|
|
|
DEFAULTS = {
|
|
|
|
# allowed resources limit hardcoded because cannot be retrieved from the API.
|
2020-04-02 06:15:36 +00:00
|
|
|
"ALLOWED_RESOURCES": defaultdict(
|
|
|
|
allowed_resources_default_factory,
|
2020-01-22 11:53:12 +00:00
|
|
|
{
|
2020-04-02 06:15:36 +00:00
|
|
|
'INDIVIDUAL':
|
|
|
|
{
|
|
|
|
# 'disk': 1024,
|
|
|
|
# 'traffic': 2048,
|
|
|
|
'mailbox': 2,
|
|
|
|
},
|
|
|
|
'ASSOCIATION': {
|
|
|
|
# 'disk': 5 * 1024,
|
|
|
|
# 'traffic': 20 * 1024,
|
|
|
|
'mailbox': 10,
|
|
|
|
}
|
2020-01-22 11:53:12 +00:00
|
|
|
}
|
2020-04-02 06:15:36 +00:00
|
|
|
),
|
2020-02-17 12:46:13 +00:00
|
|
|
"URL_DB_PHPMYADMIN": "https://phpmyadmin.pangea.org/",
|
2022-02-18 06:55:30 +00:00
|
|
|
"URL_MAILTRAIN": "https://grups.pangea.org/",
|
2020-02-17 12:46:13 +00:00
|
|
|
"URL_SAAS_GITLAB": "https://gitlab.pangea.org/",
|
|
|
|
"URL_SAAS_OWNCLOUD": "https://nextcloud.pangea.org/",
|
|
|
|
"URL_SAAS_WORDPRESS": "https://blog.pangea.org/",
|
2019-12-12 14:01:51 +00:00
|
|
|
}
|
2020-01-22 11:53:12 +00:00
|
|
|
|
|
|
|
ALLOWED_RESOURCES = getsetting("ALLOWED_RESOURCES")
|
|
|
|
|
|
|
|
URL_DB_PHPMYADMIN = getsetting("URL_DB_PHPMYADMIN")
|
|
|
|
|
|
|
|
URL_MAILTRAIN = getsetting("URL_MAILTRAIN")
|
|
|
|
|
|
|
|
URL_SAAS_GITLAB = getsetting("URL_SAAS_GITLAB")
|
2020-01-23 15:12:40 +00:00
|
|
|
|
|
|
|
URL_SAAS_OWNCLOUD = getsetting("URL_SAAS_OWNCLOUD")
|
|
|
|
|
|
|
|
URL_SAAS_WORDPRESS = getsetting("URL_SAAS_WORDPRESS")
|