Code

Opened 3 years ago

Closed 3 years ago

Last modified 6 months ago

#15809 closed New feature (invalid)

Add optional obj parameter to ModelAdmin.has_add_permission

Reported by: EnTeQuAk Owned by: nobody
Component: contrib.admin Version: 1.3
Severity: Normal Keywords:
Cc: cg@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If one is to overwrite has_add_permission it may sometimes help to rely on an optional object parameter that is applied. For example it's required to properly check if one can add some new inline-objects on an parent object that can has a state "editable" or "not editable".

The patch is very simple and does not change any behavior.

Attachments (1)

add_object_has_add_perm.diff (1.7 KB) - added by EnTeQuAk 3 years ago.

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by EnTeQuAk

comment:1 follow-up: Changed 3 years ago by EnTeQuAk

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

damnit, just ignore it... I was wrong about the usage of that function.

comment:2 in reply to: ↑ 1 Changed 6 months ago by anonymous

  • Easy pickings unset
  • UI/UX unset

Replying to EnTeQuAk:

damnit, just ignore it... I was wrong about the usage of that function.

What funtion i have to use to have that behaviour? When i have an InlineModelAdmin, in some circumstances i need that the has_add_permission depends on the parent obj

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.