summaryrefslogtreecommitdiff
path: root/src/mailman/rest/listconf.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-04-06 21:39:34 -0400
committerBarry Warsaw2015-04-06 21:39:34 -0400
commita499404b568b303697b1969d8766f7f8433b76a7 (patch)
treedc410aa3a1179d8509a58f2978a89943f3664d08 /src/mailman/rest/listconf.py
parent20edc89f208b201e34628cc021c5bfe36ef5a035 (diff)
downloadmailman-a499404b568b303697b1969d8766f7f8433b76a7.tar.gz
mailman-a499404b568b303697b1969d8766f7f8433b76a7.tar.zst
mailman-a499404b568b303697b1969d8766f7f8433b76a7.zip
Diffstat (limited to 'src/mailman/rest/listconf.py')
-rw-r--r--src/mailman/rest/listconf.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mailman/rest/listconf.py b/src/mailman/rest/listconf.py
index e83f52833..d618ce116 100644
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -32,7 +32,8 @@ from mailman.interfaces.autorespond import ResponseAction
from mailman.interfaces.mailinglist import IAcceptableAliasSet, ReplyToMunging
from mailman.rest.helpers import (
GetterSetter, bad_request, etag, no_content, okay)
-from mailman.rest.validator import PatchValidator, Validator, enum_validator
+from mailman.rest.validator import (
+ PatchValidator, Validator, enum_validator, list_of_strings_validator)
@@ -72,14 +73,6 @@ def pipeline_validator(pipeline_name):
raise ValueError('Unknown pipeline: {}'.format(pipeline_name))
-def list_of_str(values):
- """Turn a list of things into a list of unicodes."""
- for value in values:
- if not isinstance(value, str):
- raise ValueError('Expected str, got {!r}'.format(value))
- return values
-
-
# This is the list of IMailingList attributes that are exposed through the
# REST API. The values of the keys are the GetterSetter instance holding the
@@ -96,7 +89,7 @@ def list_of_str(values):
# (e.g. datetimes, timedeltas, enums).
ATTRIBUTES = dict(
- acceptable_aliases=AcceptableAliases(list_of_str),
+ acceptable_aliases=AcceptableAliases(list_of_strings_validator),
admin_immed_notify=GetterSetter(as_boolean),
admin_notify_mchanges=GetterSetter(as_boolean),
administrivia=GetterSetter(as_boolean),