cal-itp / benefits

Transit benefits enrollment, minus the paperwork.
https://docs.calitp.org/benefits
GNU Affero General Public License v3.0
25 stars 9 forks source link

AuthProvider should have friendly / useful display name in the Admin #2065

Closed thekaveman closed 2 months ago

thekaveman commented 2 months ago

Currently the [AuthProvider]() model, given that is is never user-facing, does not have any fields that capture a label or name specifically for display to an end-user, e.g. within the Admin. So the default is a Django constructed named based on the class and ID:

image

We do have the field client_name that could be used, which distinguishes each AuthProvider in the configuration and for the IdG. This field is currently marked as Read: Transit Agency in the admin config guide, which is the most open read permission (i.e. any user that can log in to the admin can read this field).

Expected behavior

Additional context

The super simple way to do this is to implement the __str__ method on the model class, to return the text of the label you want it to use (in this case, client_name). This is how other model classes implement their labels, e.g. PemData and TransitAgency