From 9474b37bdf6675b275b154432283cf2ef6235215 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Sat, 25 Mar 2006 20:40:00 +0000 Subject: [PATCH] magic-removal: Removed the 'Save and continue editing' button in the case where user does not have the 'change' permission, since the button does not allow them to actually do that in that situation. git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2563 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templatetags/admin_modify.py | 2 +- django/contrib/admin/views/main.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index 8d5cbb24a8..02d717e7d6 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/django/contrib/admin/templatetags/admin_modify.py @@ -32,7 +32,7 @@ def submit_row(context): and (change or context['show_delete'])), 'show_save_as_new': not is_popup and change and opts.admin.save_as, 'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add']), - 'show_save_and_continue': not is_popup, + 'show_save_and_continue': not is_popup and context['has_change_permission'], 'show_save': True } submit_row = register.inclusion_tag('admin/submit_line', takes_context=True)(submit_row) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 79894d4de0..c9fc014cc4 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -201,6 +201,7 @@ def render_change_form(model, manipulator, context, add=False, change=False, for 'add': add, 'change': change, 'has_delete_permission': context['perms'][app_label][opts.get_delete_permission()], + 'has_change_permission': context['perms'][app_label][opts.get_change_permission()], 'has_file_field': opts.has_field_type(models.FileField), 'has_absolute_url': hasattr(model, 'get_absolute_url'), 'auto_populated_fields': auto_populated_fields,