Skip to content

Commit

Permalink
fix(models): override display string for AuthProvider
Browse files Browse the repository at this point in the history
so it gets a more normal label in Admin screens
  • Loading branch information
thekaveman committed May 3, 2024
1 parent 20ce4c2 commit 9915910
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions benefits/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def supports_sign_out(self):
def client_id(self):
return get_secret_by_name(self.client_id_secret_name)

def __str__(self) -> str:
return self.client_name


class EligibilityType(models.Model):
"""A single conditional eligibility type."""
Expand Down
1 change: 1 addition & 0 deletions tests/pytest/core/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_PemData_data_text_secret_name_and_remote__uses_remote(
def test_model_AuthProvider(model_AuthProvider):
assert not model_AuthProvider.supports_claims_verification
assert model_AuthProvider.supports_sign_out
assert str(model_AuthProvider) == model_AuthProvider.client_name


@pytest.mark.django_db
Expand Down

0 comments on commit 9915910

Please sign in to comment.