summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2015-12-17 18:55:04 -0500
committerBarry Warsaw2015-12-17 18:55:04 -0500
commite916272dbbafa8a218993d9b74172b2488fb342e (patch)
treef7a88b751ff3477d21139f6c2ac80b46f79b09b6 /src
parentbb1d8bfb9673bd12484380502fff124fdd5d786d (diff)
downloadmailman-e916272dbbafa8a218993d9b74172b2488fb342e.tar.gz
mailman-e916272dbbafa8a218993d9b74172b2488fb342e.tar.zst
mailman-e916272dbbafa8a218993d9b74172b2488fb342e.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/rest/listconf.py8
-rw-r--r--src/mailman/rest/tests/test_listconf.py6
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):