alaveteli
alaveteli copied to clipboard
Record prominence reason on the event when editing through "Edit metadata"
During the first manual transparency report we tried to tally the reasons which requests were hidden. In doing so we noticed that when requests have their prominence changed through the "Edit metadata" form no :reason
param is recorded in the InfoRequestEvent
. See https://github.com/mysociety/whatdotheyknow-theme/issues/922#issuecomment-980061066.
~To create a better audit trail when editing prominence in this way we could check whether the :prominence
attribute was changed, and if so, redirect to an interstitial where a prominence reason is requested. This can then get added to the edit
event that gets created.~
~~EDIT: An extra form field reveal is a better approach https://github.com/mysociety/alaveteli/issues/6790#issuecomment-1041587428.~~
A subtlety here is that when we record the reason through the "hide and notify" action it's set to a request status ("not_foi"
or "vexatious"
) rather than free text. Might want to use some sort of canned reasons a la #6487.
~~As an alternative approach, we could reveal a required "prominence reason" field with JavaScript if the prominence field is changed. This would probably be simpler than dealing with an interstitial. We'd want to make the prominence reason field required if revealed. HTML validation is probably fine, though we could add model validation too.~~
Adding an InfoRequest#prominence_reason
is a better way of handling the form field (https://github.com/mysociety/alaveteli/issues/6746). This issue now just exists to remember to record the form field's value when creating the event.
Related to ensuring it's always recorded on change https://github.com/mysociety/alaveteli/issues/7214.
Closing in favour of https://github.com/mysociety/alaveteli/issues/6746#issuecomment-1133038351