#1797 Delete a custom field value if it was submitted with empty contents
Merged by pingou. Opened by puiterwijk.
puiterwijk/pagure fix-empty-field  into  master

Download 1797.patch

Fixes: pagure-importer#107
Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com

RIP https://pagure.io/pagure-importer/pull-request/108

This is better.

Optional: How about if not value? It's a little less explicit, but will probably also do what you want and is less wordy.

Looks good to me.

At first I thought like you, but then I realized that not value would become problematic for boolean fields and/or if the field contains a 0 (although this one would likely appear as '0' and thus not be a problem).

That does mean that we may need to be careful to transform None into False for boolean fields as by default in HTML, if no value is provided for a checkbox it is assumed to be False (but it is in fact None)

Looks good to me as well, I'll want to test its behavior with boolean custom fields before merging though.

So it works for me, but only with this patch:

0001-Fix-resetting-the-value-of-a-boolean-custom-field.patch

And here is an updated version of the patch:
0001-Fix-resetting-the-value-of-a-boolean-custom-field.patch

1 new commit added

  • Fix resetting the value of a boolean custom field

The patch to fix the unit-tests is: 0001-Fix-the-unit-tests-for-the-change-made-to-custom-fie.patch

1 new commit added

  • Fix the unit-tests for the change made to custom fields

rebased

Alright, let's merge, thanks for the patch! :)

Pull-Request has been merged by pingou

Metadata