bug-2028936: FieldError in Django admin for policy exceptions search field#7178
Conversation
biancadanforth
left a comment
There was a problem hiding this comment.
Straightforward enough!
A few notes:
Your PR description states that we need to set the value to a valid one from list_display, but this isn't correct. list_display controls what columns are displayed in the table, some of which aren't attributes on the PolicyException (e.g. get_user_email is a method on the PolicyExceptionAdmin class). The value needs to be set to a valid one from the set of attributes on the PolicyException. The Sentry error message indicates this: "Cannot resolve keyword 'notes' into field. Choices are: comment, created, id, user, user_id" (id is auto-generated).
Normally any change we make should have an accompanying test. Since this is an admin page, and there are currently no PolicyException tests FWICT (which may explain how this bug snuck in in the first place), I won't block on that.
Because:
This PR:
notesfield insearch_fieldsto a valid value in thePolicyExceptionmethod, which in our case iscomment