From 014e88aa24f9e1d2c40f8cf6129fd7a18d193d0e Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 17 Oct 2025 10:35:47 +0200 Subject: [PATCH] remove the help text about billing entity being read only The issue is that when obj.has_inherited_billing_entity is True, the code adds "billing_entity" to the readonly fields. When a field is marked as readonly, Django may exclude it from form.base_fields, which causes a KeyError when trying to access it. --- src/servala/core/admin.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/servala/core/admin.py b/src/servala/core/admin.py index 1aec22a..c0beb9e 100644 --- a/src/servala/core/admin.py +++ b/src/servala/core/admin.py @@ -73,16 +73,6 @@ class OrganizationAdmin(admin.ModelAdmin): return readonly_fields - def get_form(self, request, obj=None, **kwargs): - form = super().get_form(request, obj, **kwargs) - - if obj and obj.has_inherited_billing_entity: - form.base_fields["billing_entity"].help_text = _( - "This billing entity is inherited from the organization's origin and cannot be modified." - ) - - return form - @admin.register(BillingEntity) class BillingEntityAdmin(admin.ModelAdmin):