See https://pagure.io/pagure/issue/1916
Thoughts on using the same structure as we did above? like flask.request.form.getlist('custom_key_notify') ?
flask.request.form.getlist('custom_key_notify')
What about just notify? This is nitpick I realize it :)
notify
:) I tried that, but if a field does not set notify checkbox, then the list is missing an element, and everything gets all screwed up. So if there are 4 fields and only two are using notify, the list generated by "getlist" only has two values, and we can't tell which fields these belong to. We have to process it this way to get the order right.
The other fields are key_type, key_data, etc, I was just being consistent to the model, but whatever you would like :)
Oh true, in HTML for checkbox the absence of a value equals False, while the presence of a value is True, so for all 'False' checkbox there will be nothing...
Fair :)
rebased
Rebased since there are no outstanding issues with this PR.
Ok the alembic migration wasn't right and this is currently breaking the tests, so I've fixed the former and will fix the tests
Ok the alembic migration wasn't right
What was wrong with the revision script? Just curious.
It was setting nullable=False which fails if there is already content in the table.
nullable=False
So you need to add the table with nullable=True, then update all the rows in the table then change the field to nullable=False
nullable=True
Ok, alembic migration adjusted and tests fixed (by making notify an optional argument in pagure.lib.set_custom_key_fields
pagure.lib.set_custom_key_fields
This looks good to me
+1 Ack from me
I'm going to wait on jenkins before merging :)
Ok jenkins failed but for un-related reasons, so let's merge this :)
Pull-Request has been merged by pingou
See https://pagure.io/pagure/issue/1916