diff options
| author | Barry Warsaw | 2010-09-01 10:39:36 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2010-09-01 10:39:36 -0400 |
| commit | ea4a29397a470cc9f82aaea4717ffce423d61101 (patch) | |
| tree | b847fa6ded4f654080b7e7cdc5ec9dba8e768709 /src/mailman/rest/validator.py | |
| parent | 6e40cd75cd88ef930ced8c1df15ebc93dbf683d4 (diff) | |
| download | mailman-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.py | 7 |
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 |
