mirror of
https://github.com/django/django.git
synced 2025-06-06 20:19:13 +00:00
[2.2.x] Refs #30097 -- Fixed typos in InlineModelAdmin.has_add_permission() deprecation comments.
This commit is contained in:
parent
a9feec5c70
commit
ee9bd8c310
@ -2127,7 +2127,7 @@ class InlineModelAdmin(BaseModelAdmin):
|
|||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
def has_add_permission(self, request, obj=None):
|
def has_add_permission(self, request, obj=None):
|
||||||
# RemovedInDjango31Warning: obj becomes a mandatory argument.
|
# RemovedInDjango30Warning: obj becomes a mandatory argument.
|
||||||
if self.opts.auto_created:
|
if self.opts.auto_created:
|
||||||
# We're checking the rights to an auto-created intermediate model,
|
# We're checking the rights to an auto-created intermediate model,
|
||||||
# which doesn't have its own individual permissions. The user needs
|
# which doesn't have its own individual permissions. The user needs
|
||||||
|
@ -798,7 +798,7 @@ class ModelAdminPermissionTests(SimpleTestCase):
|
|||||||
self.assertIsInstance(inline_instances[0], ConcertInline)
|
self.assertIsInstance(inline_instances[0], ConcertInline)
|
||||||
|
|
||||||
def test_inline_has_add_permission_without_obj(self):
|
def test_inline_has_add_permission_without_obj(self):
|
||||||
# This test will be removed in Django 3.1 when `obj` becomes a required
|
# This test will be removed in Django 3.0 when `obj` becomes a required
|
||||||
# argument of has_add_permission() (#27991).
|
# argument of has_add_permission() (#27991).
|
||||||
class ConcertInline(TabularInline):
|
class ConcertInline(TabularInline):
|
||||||
model = Concert
|
model = Concert
|
||||||
|
Loading…
x
Reference in New Issue
Block a user