|
@@ -20,19 +20,12 @@ import os
|
|
|
|
|
|
|
|
from django.utils.translation import ugettext_lazy as _t
|
|
from django.utils.translation import ugettext_lazy as _t
|
|
|
|
|
|
|
|
-from desktop.lib.conf import Config, coerce_bool
|
|
|
|
|
|
|
+from desktop.lib.conf import Config, coerce_bool, coerce_csv
|
|
|
|
|
|
|
|
|
|
|
|
|
BASEDIR = os.path.dirname(os.path.abspath(__file__))
|
|
BASEDIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
|
-def csv(value):
|
|
|
|
|
- if isinstance(value, str):
|
|
|
|
|
- return value.split(',')
|
|
|
|
|
- elif isinstance(value, list):
|
|
|
|
|
- return value
|
|
|
|
|
- return None
|
|
|
|
|
-
|
|
|
|
|
def dict_list_map(value):
|
|
def dict_list_map(value):
|
|
|
if isinstance(value, str):
|
|
if isinstance(value, str):
|
|
|
d = {}
|
|
d = {}
|
|
@@ -73,13 +66,13 @@ ALLOW_UNSOLICITED = Config(
|
|
|
REQUIRED_ATTRIBUTES = Config(
|
|
REQUIRED_ATTRIBUTES = Config(
|
|
|
key="required_attributes",
|
|
key="required_attributes",
|
|
|
default=['uid'],
|
|
default=['uid'],
|
|
|
- type=csv,
|
|
|
|
|
|
|
+ type=coerce_csv,
|
|
|
help=_t("Required attributes to ask for from IdP."))
|
|
help=_t("Required attributes to ask for from IdP."))
|
|
|
|
|
|
|
|
OPTIONAL_ATTRIBUTES = Config(
|
|
OPTIONAL_ATTRIBUTES = Config(
|
|
|
key="optional_attributes",
|
|
key="optional_attributes",
|
|
|
default=[],
|
|
default=[],
|
|
|
- type=csv,
|
|
|
|
|
|
|
+ type=coerce_csv,
|
|
|
help=_t("Optional attributes to ask for from IdP."))
|
|
help=_t("Optional attributes to ask for from IdP."))
|
|
|
|
|
|
|
|
METADATA_FILE = Config(
|
|
METADATA_FILE = Config(
|