cal-itp / benefits

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

EligibilityVerifier.api_auth_key_secret_name required in the Admin #2072

Closed thekaveman closed 5 months ago

thekaveman commented 5 months ago

When trying to edit an existing or add a new EligibilityVerifier model in the Admin, the following error message is displayed:

image

This is despite the field in the model being marked with null=True, blank=True

It looks like the bug is in this override of the blank kwarg in SecretNameField:

# similar to max_length, enforce at the field (form) validation level to not allow blanks
kwargs["blank"] = False

We want blank = True to allow the form to pass validation in the Admin.

To Reproduce

Steps to reproduce the behavior:

  1. Open the Admin
  2. Click on Eligibility verifiers
  3. Click an existing one and click the Save button (no changes necessary)
  4. See error

Expected behavior

This is an optional field. It should not be required to save an EligibilityVerifier in the Admin.