1👍
The site explains why this is problematic:
This means that even if it is a POST request, it will take None, and thus as result the form is not bounded.
You can see that if you poke through the source. The first argument to the form initializer is data
, and the initializer contains this line:
self.is_bound = data is not None or files is not None
As mentioned, if data
is None
, the form will not be considered to be bound. This has the consequence of the form never being considered to be valid:
def is_valid(self):
"""Return True if the form has no errors, or False otherwise."""
return self.is_bound and not self.errors
This would be problematic if you’re doing proper validation on the form after.
Source:stackexchange.com