Code

Ticket #3817: admin_modify.diff

File admin_modify.diff, 863 bytes (added by Simon G. <dev@…>, 7 years ago)

Patch implementing reza@…'s suggested fix.

Line 
1Index: django/contrib/admin/templatetags/admin_modify.py
2===================================================================
3--- django/contrib/admin/templatetags/admin_modify.py   (revision 4828)
4+++ django/contrib/admin/templatetags/admin_modify.py   (working copy)
5@@ -44,7 +44,7 @@
6         'show_delete_link': (not is_popup and context['has_delete_permission']
7                               and (change or context['show_delete'])),
8         'show_save_as_new': not is_popup and change and opts.admin.save_as,
9-        'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add']),
10+        'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add']) and context['has_add_permission'],
11         'show_save_and_continue': not is_popup and context['has_change_permission'],
12         'show_save': True
13     }