When an image uploaded as a sponsor benefit was broken (unparseable), we
would incorrectly still show the "confirm preview looks ok" checkbox
below the error message. If the user confirmed that the preview (which
was non-existant and replaced with an error message) looked OK, we would
store an empty image in the database and consider the benefit OK.
Instead, we're of course not supposed to show the preview checkbox at
all if the image uploaded is broken.
if 'image' not in self._errors:
# Unless there is an error already flagged in the clean_image method
self._errors['image'] = self.error_class(['This field is required'])
- self._delete_stage2_fields()
+
+ self._delete_stage2_fields()
return self.cleaned_data