Browse Source

Fixed a bug that caused validation errors when saving change form.

Tomek Wójcik 1 year ago
parent
commit
1a22abe211

+ 9 - 0
django_changelist_inline/admin.py

@@ -90,6 +90,15 @@ class ChangelistInline(InlineModelAdmin):
         self.request = None
         self.changelist_model_admin = None
 
+    def has_add_permission(self, request, obj=None):
+        return False
+
+    def has_change_permission(self, request, obj=None):
+        return False
+
+    def has_delete_permission(self, request, obj=None):
+        return False
+
     def bind(self, request, parent_instance):
         internal_request = copy.copy(request)
         internal_request.GET = QueryDict(mutable=False)

+ 1 - 0
django_changelist_inline/templates/django_changelist_inline/changelist_inline.html

@@ -1,5 +1,6 @@
 {% load i18n admin_list %}
 
+{{ inline_admin_formset.formset.management_form }}
 {% with cl=inline_admin_formset.opts.changelist %}
   {% if cl %}
     <div class="module django_changelist_inline">