Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#15809 closed New feature (invalid)

Add optional obj parameter to ModelAdmin.has_add_permission

Reported by: Christopher Grebs 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 Christopher Grebs 13 years ago.

Download all attachments as: .zip

Change History (3)

by Christopher Grebs, 13 years ago

comment:1 by Christopher Grebs, 13 years ago

Resolution: invalid
Status: newclosed

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

in reply to:  1 comment:2 by anonymous, 11 years ago

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

Note: See TracTickets for help on using tickets.
Back to Top