summaryrefslogtreecommitdiff
path: root/src/mailman/rest/validator.py
diff options
context:
space:
mode:
authorBarry Warsaw2010-09-01 10:39:36 -0400
committerBarry Warsaw2010-09-01 10:39:36 -0400
commitea4a29397a470cc9f82aaea4717ffce423d61101 (patch)
treeb847fa6ded4f654080b7e7cdc5ec9dba8e768709 /src/mailman/rest/validator.py
parent6e40cd75cd88ef930ced8c1df15ebc93dbf683d4 (diff)
downloadmailman-ea4a29397a470cc9f82aaea4717ffce423d61101.tar.gz
mailman-ea4a29397a470cc9f82aaea4717ffce423d61101.tar.zst
mailman-ea4a29397a470cc9f82aaea4717ffce423d61101.zip
Ugly, ugly, ugly hack to enable the non-standard HTTP verb PATCH for partial
resource updates. None of the lower components (well, except restish) actually allows us to extend things for PATCH in any kind of principled way. I am the Kludge King.
Diffstat (limited to 'src/mailman/rest/validator.py')
-rw-r--r--src/mailman/rest/validator.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mailman/rest/validator.py b/src/mailman/rest/validator.py
index e9bcf4729..cf51cee75 100644
--- a/src/mailman/rest/validator.py
+++ b/src/mailman/rest/validator.py
@@ -61,7 +61,12 @@ class Validator:
# in the pre-converted dictionary. All keys which show up more than
# once get a list value.
missing = object()
- for key, new_value in request.POST.items():
+ # This is a gross hack to allow PATCH. See helpers.py for details.
+ try:
+ items = request.PATCH.items()
+ except AttributeError:
+ items = request.POST.items()
+ for key, new_value in items:
old_value = form_data.get(key, missing)
if old_value is missing:
form_data[key] = new_value