Opened 18 years ago
Closed 17 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: | no | UI/UX: | no |
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)
by , 18 years ago
Attachment: | admin_modify.diff added |
---|
comment:1 by , 18 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 18 years ago
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 by , 18 years ago
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.
comment:4 by , 18 years ago
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).
by , 17 years ago
Attachment: | skip_save_as_without_perm_r6442.2.patch added |
---|
comment:7 by , 17 years ago
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 by , 17 years ago
Version: | SVN → newforms-admin |
---|
comment:9 by , 17 years ago
Cc: | added |
---|
Patch implementing reza@…'s suggested fix.