Skip to content

Commit f630b3b

Browse files
committed
Fix is_bound for empty forms by checking request method instead of data truthiness
Empty POST requests (e.g., delete forms with no fields) produced a falsy empty QueryDict, causing is_bound to be False and validation to never run.
1 parent 1f9c16e commit f630b3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plain/plain/forms/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
self.data = request.form_data
9191
self.files = request.files
9292

93-
self.is_bound = bool(self.data or self.files)
93+
self.is_bound = request.method in ("POST", "PUT", "PATCH")
9494

9595
self._auto_id = auto_id
9696
if prefix is not None:

0 commit comments

Comments
 (0)