diff options
| author | Mark Sapiro | 2017-02-19 17:37:05 -0800 |
|---|---|---|
| committer | Mark Sapiro | 2017-02-19 17:44:16 -0800 |
| commit | c39ef107c1765f1eb937bfcaae2e23dda0b4c581 (patch) | |
| tree | c7df0bb15b8631d12284dcc548e49b6d37569f70 /src/mailman/rest/lists.py | |
| parent | 1bde5f4b0f91831b22ebba135dc361ad9d622b3e (diff) | |
| download | mailman-c39ef107c1765f1eb937bfcaae2e23dda0b4c581.tar.gz mailman-c39ef107c1765f1eb937bfcaae2e23dda0b4c581.tar.zst mailman-c39ef107c1765f1eb937bfcaae2e23dda0b4c581.zip | |
Diffstat (limited to 'src/mailman/rest/lists.py')
| -rw-r--r-- | src/mailman/rest/lists.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mailman/rest/lists.py b/src/mailman/rest/lists.py index e665515ec..4b467afb3 100644 --- a/src/mailman/rest/lists.py +++ b/src/mailman/rest/lists.py @@ -20,8 +20,10 @@ from lazr.config import as_boolean from mailman.app.digests import ( bump_digest_number_and_volume, maybe_send_digest_now) -from mailman.app.lifecycle import create_list, remove_list +from mailman.app.lifecycle import ( + InvalidListNameError, create_list, remove_list) from mailman.config import config +from mailman.interfaces.address import InvalidEmailAddressError from mailman.interfaces.domain import BadDomainSpecificationError from mailman.interfaces.listmanager import ( IListManager, ListAlreadyExistsError) @@ -246,6 +248,12 @@ class AllLists(_ListBase): except BadDomainSpecificationError as error: reason = 'Domain does not exist: {}'.format(error.domain) bad_request(response, reason.encode('utf-8')) + except InvalidListNameError as error: + reason = 'Invalid list name: {}'.format(error.listname) + bad_request(response, reason.encode('utf-8')) + except InvalidEmailAddressError as error: + reason = 'Invalid list posting address: {}'.format(error.email) + bad_request(response, reason.encode('utf-8')) else: location = self.api.path_to('lists/{0}'.format(mlist.list_id)) created(response, location) |
