Code

Opened 2 years ago

Closed 2 years ago

#18619 closed Bug (duplicate)

make sure get_inline_instances() follows the same API convention as the other functions

Reported by: sjaensch Owned by: sjaensch
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When developing the patch for ticket #8060, I missed the fact that the BaseModelAdmin / ModelAdmin API in django.contrib.admin.options passes an instance object where applicable, paving the way for implementations of object-level permissions. Therefore, the newly created method get_inline_instances should accept an instance parameter and pass it along accordingly.

Similar ModelAdmin methods that already support the instance parameter are get_fieldsets(), get_readonly_fields(), get_prepopulated_fields() or get_formsets().

I'll post the link to the pull request as a comment. The patch passes the Django test suite.

Attachments (0)

Change History (2)

comment:1 Changed 2 years ago by sjaensch

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Type changed from Cleanup/optimization to Bug

comment:2 Changed 2 years ago by aaugustin

  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #17856.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.