Skip to content

Commit

Permalink
feat(admin): specify read-only fields for Cal-ITP for TransitAgency
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Jul 18, 2024
1 parent 320ce88 commit c212615
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions benefits/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ def get_exclude(self, request, obj=None):
else:
return super().get_exclude(request, obj)

def get_readonly_fields(self, request, obj=None):
if request.user.groups.contains(Group.objects.get(name=STAFF_GROUP_NAME)):
return [
"agency_id",
"payment_processor",
"index_template",
"eligibility_index_template",
]
else:
return super().get_readonly_fields(request, obj)


def pre_login_user(user, request):
logger.debug(f"Running pre-login callback for user: {user.username}")
Expand Down

0 comments on commit c212615

Please sign in to comment.