Comment 2 for bug 1393727

Revision history for this message
Alan Fung (alanfung) wrote :

I've attached the suggested patch as mentioned in my last comment.

I believe "copy_from" and "image_file" are not previously marked as "required" in the "CreateImageForm" class due to it being conditional, i.e. exactly one of "copy_from" and "image_file" is required.

In the suggested patch, we re-implement "conditionally required" without working around setting "required" to "False". This is possibly an improvement because it does not compromise the benefits of having a field set as required.

Possibly an even better solution is to implement a "conditionally required" property for a form field, but that can be an overkill.