#29723: Backwards-incompatible change of has_add_permission in 2.1
----------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Carlton Gibson):
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Refs #27991 -- Add obj arg to InlineModelAdmin.has_add_permission()
There's a check to determine how to call has_add_permission():
{{{
# RemovedInDjango30Warning: obj will be a required argument.
args = get_func_args(inline.has_add_permission)
if 'obj' in args:
inline_has_add_permission =
inline.has_add_permission(request, obj)
else:
inline_has_add_permission =
inline.has_add_permission(request)
}}}
Looks like this should be applied to the other call sites.
#8936 -- Added a view permission and a read-only admin made the addition
of the offending `can_add = self.has_add_permission(request, obj) if
request else True` call raising the exception here.
--
Ticket URL: <https://code.djangoproject.com/ticket/29723#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.5db75a6d337cbab8ad230db4368d318d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.