Opened 5 years ago

Closed 5 years ago

Last modified 3 years 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


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 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by EnTeQuAk

comment:1 follow-up: Changed 5 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 3 years 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

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