1. Jesper Noehr
  2. django-piston
  3. Issues
Issue #197 new

request.data is None

Ian Lewis
created an issue

When there is no ctype piston sets request.data to request.POST but when there is a ctype but no loader it sets request.data to None.

This feels a bit inconsistent and you have to handle the case where request.data is None. When request.data is None you can't just pass request.data to a form because it will be unbound. Unbound forms are never valid so you can have issues unless you create your form instance like this

{{{ form = MyForm(request.data or {}) }}}

Comments (1)

  1. Log in to comment