Skip to content

Commit 4ec18b7

Browse files
committed
Allow errors to be added to unclean forms
1 parent 185c346 commit 4ec18b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plain/plain/forms/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ def __iter__(self):
203203
self._errors[field].extend(error_list)
204204

205205
# The field had an error, so removed it from the final data
206-
if field in self.cleaned_data:
206+
# (we use getattr here so errors can be added to uncleaned forms)
207+
if field in getattr(self, "cleaned_data", {}):
207208
del self.cleaned_data[field]
208209

209210
def full_clean(self):

0 commit comments

Comments
 (0)