From 081d9715be07fd2b143fb5a97940dac2fe70cc4f Mon Sep 17 00:00:00 2001 From: ince-dbt <148454056+ince-dbt@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:30:24 +0100 Subject: [PATCH] Fix/RR-1362 set fields readonly in the customer response section (#5357) * Set few lead officer fields to readonly * Remove unnecessary codes --- datahub/export_win/admin.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/datahub/export_win/admin.py b/datahub/export_win/admin.py index 6c664947fe..28f9a0e56c 100644 --- a/datahub/export_win/admin.py +++ b/datahub/export_win/admin.py @@ -22,7 +22,7 @@ class BaseTabularInline(admin.TabularInline): extra = 0 can_delete = False - exclude = ('is_deleted', 'id') + exclude = ('id',) class BreakdownInlineForm(ModelForm): @@ -77,7 +77,7 @@ class BaseStackedInline(admin.StackedInline): inline_classes = ('grp-collapse grp-open',) extra = 0 can_delete = False - exclude = ('is_deleted', 'created_by', 'modified_by') + exclude = ('created_by', 'modified_by') class CustomerResponseInlineForm(ModelForm): @@ -104,7 +104,11 @@ class CustomerResponseInline(BaseStackedInline): model = CustomerResponse form = CustomerResponseInlineForm - extra = 0 + readonly_fields = ( + 'lead_officer_email_notification_id', + 'lead_officer_email_delivery_status', + 'lead_officer_email_sent_on', + ) class WinAdminForm(ModelForm):