Code

Ticket #14679: 14679.diff

File 14679.diff, 830 bytes (added by fisadev, 4 years ago)
Line 
1Index: django/contrib/auth/admin.py
2===================================================================
3--- django/contrib/auth/admin.py        (revision 14551)
4+++ django/contrib/auth/admin.py        (working copy)
5@@ -137,6 +137,13 @@
6             'root_path': self.admin_site.root_path,
7         }, context_instance=RequestContext(request))
8 
9+    def response_add(self, request, obj, post_url_continue='../%s/'):
10+        '''The user model has a different workflow on add.'''
11+        # if the save button was pressed, it acts as the save and continue
12+        # editing  button
13+        if not request.POST.has_key("_addanother"):
14+            request.POST["_continue"] = 1
15+        return super(UserAdmin, self).response_add(request, obj, post_url_continue)
16 
17 admin.site.register(Group, GroupAdmin)
18 admin.site.register(User, UserAdmin)