[Django] #30097: InlineModelAdmin.has_add_permission() requires obj argument

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #30097: InlineModelAdmin.has_add_permission() requires obj argument

Django
#30097: InlineModelAdmin.has_add_permission() requires obj argument
-------------------------------------+-------------------------------------
               Reporter:  Maxim      |          Owner:  nobody
  Zemskov                            |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  2.1
  contrib.admin                      |       Keywords:  contrib.admin,
               Severity:  Normal     |  admin, inline
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 InlineModelAdmin.has_add_permission() requires obj argument:
 {{{
 def has_add_permission(self, request, obj):
     if self.opts.auto_created:
         return self.has_view_permission(request, obj)
     return super().has_add_permission(request)
 }}}

 But implementation of InlineModelAdmin._has_add_permission() says obj will
 be required in django 3.0:

 {{{
 def _has_add_permission(self, request, obj):
     # RemovedInDjango30Warning: obj will be a required argument.
     args = get_func_args(self.has_add_permission)
     return self.has_add_permission(request, obj) if 'obj' in args else
 self.has_add_permission(request)
 }}}
 So, code will crush at **{{{self.has_add_permission(request)}}}** in
 return statement with {{{missing 1 required positional argument: 'obj'}}}.

--
Ticket URL: <https://code.djangoproject.com/ticket/30097>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/055.08c13443418461a0e71413c890a143f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() requires obj argument

Django
#30097: InlineModelAdmin.has_add_permission() requires obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Normal               |               Resolution:
     Keywords:  contrib.admin,       |             Triage Stage:
  admin, inline                      |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Maxim Zemskov):

 * has_patch:  0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30097#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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.5962e2e5a0141cf51fb5b2948e6f318a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() requires obj argument

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() requires obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:
     Keywords:  contrib.admin,       |             Triage Stage:  Accepted
  admin, inline                      |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * cc: Jon, Dufresne (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 This looks related to #27991. The new test case on the PR looks right and
 fails without the patch, so pending review I'm going to accept this as a
 Release Blocker on v2.1.

--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:2>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.1fab1fdf53b3935cac5e51ff4ca96eb7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() requires obj argument

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() requires obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  Maxim
                                     |  Zemskov
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:
     Keywords:  contrib.admin,       |             Triage Stage:  Accepted
  admin, inline                      |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Maxim Zemskov):

 * status:  new => assigned
 * owner:  nobody => Maxim Zemskov


--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:3>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.1a63faa246edb6e55e3aff3b9aba7574%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by requiring obj argument (was: InlineModelAdmin.has_add_permission() requires obj argument)

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by
requiring obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  Maxim
                                     |  Zemskov
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:
     Keywords:  contrib.admin,       |             Triage Stage:  Ready for
  admin, inline                      |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * cc: Jon, Dufresne (removed)
 * stage:  Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:4>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.bb93114e41aab46d17f2f4621343dbfe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by requiring obj argument

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by
requiring obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  Maxim
                                     |  Zemskov
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  contrib.admin,       |             Triage Stage:  Ready for
  admin, inline                      |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"3c01fe30f3dd4dc1c8bb4fec816bd277d1ae5fa6" 3c01fe30]:
 {{{
 #!CommitTicketReference repository=""
 revision="3c01fe30f3dd4dc1c8bb4fec816bd277d1ae5fa6"
 Fixed #30097 -- Made 'obj' arg of InlineModelAdmin.has_add_permission()
 optional.

 Restored backwards compatibility after refs #27991.
 Regression in be6ca89396c031619947921c81b8795d816e3285.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:5>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.d1629d8373e6d228087455353ad2bf71%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by requiring obj argument

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by
requiring obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  Maxim
                                     |  Zemskov
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  contrib.admin,       |             Triage Stage:  Ready for
  admin, inline                      |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"3df13847d583f0e439d03dd85e4d8d2a36e6de73" 3df13847]:
 {{{
 #!CommitTicketReference repository=""
 revision="3df13847d583f0e439d03dd85e4d8d2a36e6de73"
 [2.1.x] Fixed #30097 -- Made 'obj' arg of
 InlineModelAdmin.has_add_permission() optional.

 Restored backwards compatibility after refs #27991.
 Regression in be6ca89396c031619947921c81b8795d816e3285.

 Backport of 3c01fe30f3dd4dc1c8bb4fec816bd277d1ae5fa6 from master.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:6>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.fec8de0dbc87768f80f64620183bad2d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by requiring obj argument

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by
requiring obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  Maxim
                                     |  Zemskov
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  contrib.admin,       |             Triage Stage:  Ready for
  admin, inline                      |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"ee9bd8c31024ec424157798b2a60a7f52f9353ee" ee9bd8c]:
 {{{
 #!CommitTicketReference repository=""
 revision="ee9bd8c31024ec424157798b2a60a7f52f9353ee"
 [2.2.x] Refs #30097 -- Fixed typos in
 InlineModelAdmin.has_add_permission() deprecation comments.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:7>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.7f4f0d9997178e42f1afc0f2f57c51da%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by requiring obj argument

Django
In reply to this post by Django
#30097: InlineModelAdmin.has_add_permission() broke backwards compatibility by
requiring obj argument
-------------------------------------+-------------------------------------
     Reporter:  Maxim Zemskov        |                    Owner:  Maxim
                                     |  Zemskov
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  2.1
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  contrib.admin,       |             Triage Stage:  Ready for
  admin, inline                      |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"1bb31708a0b1fee1a903dacca0123205a6e3690a" 1bb31708]:
 {{{
 #!CommitTicketReference repository=""
 revision="1bb31708a0b1fee1a903dacca0123205a6e3690a"
 [2.1.x] Refs #30097 -- Fixed typos in
 InlineModelAdmin.has_add_permission() deprecation comments.

 Backport of ee9bd8c31024ec424157798b2a60a7f52f9353ee from stable/2.2.x.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30097#comment:8>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.b3d42b8410e2f784a673f53a48d6c1f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.