Tweak how we detect JSON request body instead of POST params

i.e. when processing submitted form data
This commit is contained in:
Lance Edgar 2019-08-25 17:35:01 -05:00
parent 3d3ace1c2a
commit 300efe4877

View file

@ -921,7 +921,7 @@ class Form(object):
# use POST or JSON body, whichever is present
# TODO: per docs, some JS libraries may not set this flag?
# https://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request.is_xhr
if self.request.is_xhr:
if self.request.is_xhr and not self.request.POST:
controls = self.request.json_body.items()
# TODO: why in the hell is this necessary? some colander forms