Opened 11 years ago
Closed 10 years ago
#3817 closed (worksforme)
submit_row shows "Save and add another" button when user has not permission to add
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | ||
Cc: | reza@…, django@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
submit_row decide to show the "Save and add another" button when:
'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add'])
and show "Save and continue editing" when:
'show_save_and_continue': not is_popup and context['has_change_permission']
It's better to change first condition to this:
'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add']) and context['has_add_permission']
Attachments (3)
Change History (13)
Changed 11 years ago by
Attachment: | admin_modify.diff added |
---|
comment:1 Changed 11 years ago by
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 Changed 11 years ago by
Summary: | submit_row shows "Save and add another" button when user has not premission to add → submit_row shows "Save and add another" button when user has not permission to add |
---|
comment:3 Changed 11 years ago by
It's not enough!
for backward-compatibility, it's better to check context.has_key('has_add_permission'), and to make the patch effective, view of admin interface should pass the has_add_permission.
Changed 11 years ago by
Attachment: | admin_modify.2.diff added |
---|
backward-compatibility and view changes
comment:4 Changed 11 years ago by
Has patch: | unset |
---|---|
Triage Stage: | Ready for checkin → Accepted |
Admin development attention at the moment is focused on newforms-admin and we intend to merge that back into mainline fairly soon. So it's not worth applying small patches like this to the end-of-lined current admin (there's not going to be another release with the current admin).
I'll move this back to "accepted" and, at some point, a new patch should be generated against newforms-admin (either before or after it is merged).
Changed 11 years ago by
Attachment: | skip_save_as_without_perm_r6442.2.patch added |
---|
comment:7 Changed 11 years ago by
Has patch: | set |
---|
Posted the (working) patch from #5650 here, hoping that someone will notice it. As mtredinnick's comment required, this patch was created against newforms-admin.
comment:8 Changed 11 years ago by
Version: | SVN → newforms-admin |
---|
comment:9 Changed 11 years ago by
Cc: | django@… added |
---|
comment:10 Changed 10 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
works for me in [6797]
Patch implementing reza@…'s suggested fix.