summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMaximZemskov <m.zemskov1@gmail.com>2019-01-11 13:13:31 +0300
committerTim Graham <timograham@gmail.com>2019-01-11 18:02:43 -0500
commit3c01fe30f3dd4dc1c8bb4fec816bd277d1ae5fa6 (patch)
tree59dca178d22d600ff58c36130a0acb6fde250650 /django
parent8f4eee177785cba27d6181840206ff2f164f2960 (diff)
Fixed #30097 -- Made 'obj' arg of InlineModelAdmin.has_add_permission() optional.
Restored backwards compatibility after refs #27991. Regression in be6ca89396c031619947921c81b8795d816e3285.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/options.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 0d10d29a04..eb2c8cd094 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -2126,7 +2126,8 @@ class InlineModelAdmin(BaseModelAdmin):
queryset = queryset.none()
return queryset
- def has_add_permission(self, request, obj):
+ def has_add_permission(self, request, obj=None):
+ # RemovedInDjango31Warning: obj becomes a mandatory argument.
if self.opts.auto_created:
# We're checking the rights to an auto-created intermediate model,
# which doesn't have its own individual permissions. The user needs