diff options
| author | Barry Warsaw | 2015-04-07 15:21:08 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-04-07 15:21:08 -0400 |
| commit | 89f8cd6c2bc7d38c2478d87d81b4b729169b3d80 (patch) | |
| tree | 41ceebd7697d0673b9c91592c75c4ba85a8e432c /src/mailman/rest/listconf.py | |
| parent | bf00467f633ae6a8523189c1b922ca6dcd6636b8 (diff) | |
| parent | 7317b94a0b746f0287ecbc5654ec544ce0112adb (diff) | |
| download | mailman-89f8cd6c2bc7d38c2478d87d81b4b729169b3d80.tar.gz mailman-89f8cd6c2bc7d38c2478d87d81b4b729169b3d80.tar.zst mailman-89f8cd6c2bc7d38c2478d87d81b4b729169b3d80.zip | |
Diffstat (limited to 'src/mailman/rest/listconf.py')
| -rw-r--r-- | src/mailman/rest/listconf.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mailman/rest/listconf.py b/src/mailman/rest/listconf.py index 92d1169d4..04dea996f 100644 --- a/src/mailman/rest/listconf.py +++ b/src/mailman/rest/listconf.py @@ -33,7 +33,8 @@ from mailman.interfaces.mailinglist import ( IAcceptableAliasSet, ReplyToMunging, SubscriptionPolicy) 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) @@ -73,14 +74,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 @@ -97,7 +90,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), |
