From f023cb21c7de8f87a4a8c4da3d4f04a48af72a6d Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Wed, 22 Jan 2020 12:53:12 +0100 Subject: [PATCH] Add managers URLs as musician settings. --- musician/settings.py | 47 +++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/musician/settings.py b/musician/settings.py index 5581061..abc538a 100644 --- a/musician/settings.py +++ b/musician/settings.py @@ -1,14 +1,37 @@ -# allowed resources limit hardcoded because cannot be retrieved from the API. -ALLOWED_RESOURCES = { - 'INDIVIDUAL': - { - # 'disk': 1024, - # 'traffic': 2048, - 'mailbox': 2, +from django.conf import settings + + +def getsetting(name): + return getattr(settings, name, DEFAULTS.get(name)) + + +DEFAULTS = { + # allowed resources limit hardcoded because cannot be retrieved from the API. + "ALLOWED_RESOURCES": { + 'INDIVIDUAL': + { + # 'disk': 1024, + # 'traffic': 2048, + 'mailbox': 2, + }, + 'ASSOCIATION': { + # 'disk': 5 * 1024, + # 'traffic': 20 * 1024, + 'mailbox': 10, + } }, - 'ASSOCIATION': { - # 'disk': 5 * 1024, - # 'traffic': 20 * 1024, - 'mailbox': 10, - } + "URL_DB_PHPMYADMIN": "https://www.phpmyadmin.net/", + "URL_MAILTRAIN": "https://mailtrain.org/", + "URL_SAAS_WORDPRESS": "https://wordpress.org/", + "URL_SAAS_GITLAB": "https://gitlab.org/", } + +ALLOWED_RESOURCES = getsetting("ALLOWED_RESOURCES") + +URL_DB_PHPMYADMIN = getsetting("URL_DB_PHPMYADMIN") + +URL_MAILTRAIN = getsetting("URL_MAILTRAIN") + +URL_SAAS_WORDPRESS = getsetting("URL_SAAS_WORDPRESS") + +URL_SAAS_GITLAB = getsetting("URL_SAAS_GITLAB")