#31098: has_add_permission() takes 2 positional arguments but 3 were given
-------------------------------------+-------------------------------------
               Reporter:  androane   |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  3.0
  contrib.admin                      |       Keywords:  admin inlines
               Severity:  Normal     |  permission
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In n class inheriting from ModelAdmin, I'm doing



 {{{
 def get_inline_instances(self, request, obj=None):
     inline_instances = super().get_inline_instances(request, obj)
     ...
 }}}



 and the super call is throwing an error in the source code of Django here:



 {{{
     def get_inline_instances(self, request, obj=None):
         inline_instances = []
         for inline_class in self.get_inlines(request, obj):
             inline = inline_class(self.model, self.admin_site)
             if request:
                 if not (inline.has_view_or_change_permission(request, obj)
 or
                         inline.has_add_permission(request, obj) or
 # AT THIS LINE
                         inline.has_delete_permission(request, obj)):
                     continue
                 if not inline.has_add_permission(request, obj):
                     inline.max_num = 0
             inline_instances.append(inline)

         return inline_instances
 }}}

 Haven't had this problem with Django 2.0

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31098>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/051.f37be0fb59cd41252bdf71f0b1246524%40djangoproject.com.

Reply via email to