Ticket #18388: ticket_18338.2.diff

File ticket_18338.2.diff, 1.0 KB (added by Melevir, 2 years ago)

This patch is correct. There was some garbage in previous one, sorry for that.

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index 19c212d..7a5e93c 100644
    a b class InlineModelAdmin(BaseModelAdmin): 
    14671467            "fields": fields,
    14681468            "exclude": exclude,
    14691469            "formfield_callback": partial(self.formfield_for_dbfield, request=request),
    1470             "extra": self.extra,
    1471             "max_num": self.max_num,
     1470            "extra": self.get_extra(),
     1471            "max_num": self.get_max_num(),
    14721472            "can_delete": can_delete,
    14731473        }
    14741474        defaults.update(kwargs)
    class InlineModelAdmin(BaseModelAdmin): 
    15191519        return request.user.has_perm(
    15201520            self.opts.app_label + '.' + self.opts.get_delete_permission())
    15211521
     1522    def get_extra(self):
     1523        return self.extra
     1524
     1525    def get_max_num(self):
     1526        return self.max_num
     1527
    15221528
    15231529class StackedInline(InlineModelAdmin):
    15241530    template = 'admin/edit_inline/stacked.html'
Back to Top