diff options
| -rw-r--r-- | src/mailman/rest/listconf.py | 8 | ||||
| -rw-r--r-- | src/mailman/rest/tests/test_listconf.py | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mailman/rest/listconf.py b/src/mailman/rest/listconf.py index f4458b0f9..62b21644a 100644 --- a/src/mailman/rest/listconf.py +++ b/src/mailman/rest/listconf.py @@ -218,9 +218,9 @@ class ListConfiguration: def on_patch(self, request, response): """Patch the configuration (i.e. partial update).""" if self._attribute is None: - # We're PATCHing one more attributes on the list's configuration - # resource, so all the writable attributes are valid candidates - # for updating. + # We're PATCHing one or more of the attributes on the list's + # configuration resource, so all the writable attributes are valid + # candidates for updating. converters = ATTRIBUTES else: # We're PATCHing a specific list configuration attribute @@ -247,7 +247,7 @@ class ListConfiguration: # This is the case where the URL points to the list's entire # configuration resource, but the request dictionary contains a # nonexistent attribute. - not_found( + bad_request( response, 'Unknown attribute: {}'.format(error.attribute)) return except ReadOnlyPATCHRequestError as error: diff --git a/src/mailman/rest/tests/test_listconf.py b/src/mailman/rest/tests/test_listconf.py index 692541bcb..0552233bb 100644 --- a/src/mailman/rest/tests/test_listconf.py +++ b/src/mailman/rest/tests/test_listconf.py @@ -33,8 +33,8 @@ from mailman.testing.layers import RESTLayer from urllib.error import HTTPError -# The representation of the listconf resource as a dictionary. This is -# required when PUTting to the list's configuration resource. +# The representation of the listconf resource as a dictionary. This is used +# when PUTting to the list's configuration resource. RESOURCE = dict( acceptable_aliases=[ 'ant@example.com', @@ -212,7 +212,7 @@ class TestConfiguration(unittest.TestCase): call_api('http://localhost:9001/3.0/lists/ant.example.com/config', dict(bogus=1), 'PATCH') - self.assertEqual(cm.exception.code, 404) + self.assertEqual(cm.exception.code, 400) self.assertEqual(cm.exception.reason, b'Unknown attribute: bogus') def test_read_only_patch_attribute(self): |
