Skip to content

Commit

Permalink
chore(admin): ensure EnrollmentEvent.id is always read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Sep 18, 2024
1 parent 074971d commit 784abb0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions benefits/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def get_readonly_fields(self, request, obj=None):
class EnrollmentEventAdmin(admin.ModelAdmin): # pragma: no cover
list_display = ("enrollment_datetime", "transit_agency", "enrollment_flow", "enrollment_method", "verified_by")

def get_readonly_fields(self, request: HttpRequest, obj=None):
return ["id"]

def has_add_permission(self, request: HttpRequest, obj=None):
if settings.RUNTIME_ENVIRONMENT() == settings.RUNTIME_ENVS.PROD:
return False
Expand Down

0 comments on commit 784abb0

Please sign in to comment.