Properly remove "confirm preview" checkbox on broken uploads
authorMagnus Hagander <magnus@hagander.net>
Tue, 27 May 2025 12:29:10 +0000 (14:29 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 27 May 2025 12:29:10 +0000 (14:29 +0200)
commitd6250687da42786374caa956c9ef158ed313d630
tree7b949c9bf666b1c25e34f22d17df130dc34287ae
parentde4e82c2d1cbe9cefdba36d0d05700af9e99f76c
Properly remove "confirm preview" checkbox on broken uploads

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.
postgresqleu/confsponsor/benefitclasses/imageupload.py