mirror of
https://github.com/django/django.git
synced 2025-04-12 03:22:21 +00:00
[1.10.x] Fixed ModelAdmin.get_max_num() example if obj is None.
Backport of a4e9e834e3dfc8d5a024a78c765f193105d41a48 from master
This commit is contained in:
parent
8f428c8296
commit
64e4adbfef
@ -2211,7 +2211,7 @@ The ``InlineModelAdmin`` class adds:
|
||||
|
||||
def get_max_num(self, request, obj=None, **kwargs):
|
||||
max_num = 10
|
||||
if obj.parent:
|
||||
if obj and obj.parent:
|
||||
return max_num - 5
|
||||
return max_num
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user