#37026: edit_only not implemented for formsets in GenericInlineModelAdmin
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                     Type:  Bug
       Status:  new                  |                Component:
                                     |  contrib.contenttypes
      Version:  6.0                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 `BaseModelFormSet` received an `edit_only` parameter in #26412 (and
 #33822), but it looks like this was never implemented for
 `GenericInlineModelAdmin`:

 For the purposes of demonstrating the issue only, edit this test:
 {{{#!diff
 diff --git a/tests/generic_inline_admin/tests.py
 b/tests/generic_inline_admin/tests.py
 index b4833e54e7..9f1a997b00 100644
 --- a/tests/generic_inline_admin/tests.py
 +++ b/tests/generic_inline_admin/tests.py
 @@ -518,7 +518,7 @@ class GenericInlineModelAdminTest(SimpleTestCase):
                  return [(None, {"fields": ["url", "description"]})]

          ma = MediaInline(Media, self.site)
 -        form = ma.get_formset(None).form
 +        form = ma.get_formset(None, edit_only=True).form
          self.assertEqual(form._meta.fields, ["url", "description"])

      def test_get_formsets_with_inlines_returns_tuples(self):
 }}}

 {{{#!py
   File "/Users/jwalls/django/django/contrib/contenttypes/admin.py", line
 150, in get_formset
     return generic_inlineformset_factory(self.model, **defaults)
 TypeError: generic_inlineformset_factory() got an unexpected keyword
 argument 'edit_only'
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37026>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019d6df6f489-b67fe1bf-1ff3-4dc7-879c-dad07990cd68-000000%40eu-central-1.amazonses.com.

Reply via email to