﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1478	[patch] [magic-removal] Generic views, keeping up with the changes	Russell Cloran <russell@…>	Jacob	"Hi,

The generic views need to keep up with the Jones's. Here's a little patch to help them do that. (change {{{_set.add}}} to {{{_set.create}}}).

{{{
Index: django/views/generic/create_update.py
===================================================================
--- django/views/generic/create_update.py       (revision 2501)
+++ django/views/generic/create_update.py       (working copy)
@@ -39,7 +39,7 @@
             new_object = manipulator.save(new_data)

             if not request.user.is_anonymous():
-                request.user.message_set.add(message=""The %s was created sucessfully."" % model._meta.verbose_name)
+                request.user.message_set.create(message=""The %s was created sucessfully."" % model._meta.verbose_name)

             # Redirect to the new object: first by trying post_save_redirect,
             # then by obj.get_absolute_url; fail if neither works.
@@ -111,7 +111,7 @@
             manipulator.save(new_data)

             if not request.user.is_anonymous():
-                request.user.message_set.add(message=""The %s was updated sucessfully."" % model._meta.verbose_name)
+                request.user.message_set.create(message=""The %s was updated sucessfully."" % model._meta.verbose_name)

             # Do a post-after-redirect so that reload works, etc.
             if post_save_redirect:
@@ -178,7 +178,7 @@
     if request.META['REQUEST_METHOD'] == 'POST':
         object.delete()
         if not request.user.is_anonymous():
-            request.user.message_set.add(message=""The %s was deleted."" % model._meta.verbose_name)
+            request.user.message_set.create(message=""The %s was deleted."" % model._meta.verbose_name)
         return HttpResponseRedirect(post_delete_redirect)
     else:
         if not template_name:
}}}"	defect	closed	Generic views	magic-removal	normal	fixed			Unreviewed	1	0	0	0	0	0
