diff options
| author | Tim Graham <timograham@gmail.com> | 2018-12-31 09:18:26 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-01-01 09:42:14 -0500 |
| commit | 02c07be95c47efaab9da7422c33ee76142f11336 (patch) | |
| tree | 3b7a25847055424c48e6691a58fadad5ea0064f4 /django | |
| parent | 0123b67f6b8304a5c32a0fe98f97ae506977454b (diff) | |
Fixed #30050 -- Fixed InlineModelAdmin.has_change_permission() called with non-None obj during add.
Thanks andreage for the report and suggested fix.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/options.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 532f6ec1f3..e5d79d2c6d 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -1956,7 +1956,7 @@ class ModelAdmin(BaseModelAdmin): # Bypass validation of each view-only inline form (since the form's # data won't be in request.POST), unless the form was deleted. - if not inline.has_change_permission(request, obj): + if not inline.has_change_permission(request, obj if change else None): for index, form in enumerate(formset.initial_forms): if user_deleted_form(request, obj, formset, index): continue |
