Opened 17 years ago

Closed 16 years ago

#3817 closed (worksforme)

submit_row shows "Save and add another" button when user has not permission to add

Reported by: reza@… 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)

admin_modify.diff (863 bytes ) - added by Simon G. <dev@…> 17 years ago.
Patch implementing reza@…'s suggested fix.
admin_modify.2.diff (2.0 KB ) - added by reza@… 17 years ago.
backward-compatibility and view changes
skip_save_as_without_perm_r6442.2.patch (1.8 KB ) - added by Silviu Julean <sjulean@…> 16 years ago.

Download all attachments as: .zip

Change History (13)

by Simon G. <dev@…>, 17 years ago

Attachment: admin_modify.diff added

Patch implementing reza@…'s suggested fix.

comment:1 by Simon G. <dev@…>, 17 years ago

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:2 by Simon G. <dev@…>, 17 years ago

Summary: submit_row shows "Save and add another" button when user has not premission to addsubmit_row shows "Save and add another" button when user has not permission to add

comment:3 by reza@…, 17 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.

by reza@…, 17 years ago

Attachment: admin_modify.2.diff added

backward-compatibility and view changes

comment:4 by Malcolm Tredinnick, 17 years ago

Has patch: unset
Triage Stage: Ready for checkinAccepted

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).

comment:5 by James Bennett, 17 years ago

#2927 is a duplicate. Reassigning to xian.

comment:6 by James Bennett, 16 years ago

#5650 was a duplicate and has a patch.

by Silviu Julean <sjulean@…>, 16 years ago

comment:7 by Silviu Julean <sjulean@…>, 16 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 Brian Rosner, 16 years ago

Version: SVNnewforms-admin

comment:9 by anonymous, 16 years ago

Cc: django@… added

comment:10 by Honza Král, 16 years ago

Resolution: worksforme
Status: newclosed

works for me in [6797]

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