#1362 closed defect (fixed)
[patch] magic-removal: User messages
Reported by: | anonymous | Owned by: | Jacob |
---|---|---|---|
Component: | Generic views | Version: | magic-removal |
Severity: | normal | Keywords: | |
Cc: | russell@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
The following should be applied to create_update to fix message adding in the magic-removal branch.
--- create_update.py~ 2006-02-16 12:56:46.000000000 +0200
+++ create_update.py 2006-02-16 13:01:18.000000000 +0200
@@ -39,7 +39,7 @@
new_object = manipulator.save(new_data)
if not request.user.is_anonymous():
- request.user.add_message("The %s was created sucessfully." % model._meta.verbose_name)
+ request.user.message_set.add(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.
@@ -110,7 +110,7 @@
manipulator.save(new_data)
if not request.user.is_anonymous():
- request.user.add_message("The %s was updated sucessfully." % model._meta.verbose_name)
+ request.user.message_set.add(message="The %s was updated sucessfully." % model._meta.verbose_name)
# Do a post-after-redirect so that reload works, etc.
if post_save_redirect:
@@ -177,7 +177,7 @@
if request.METAREQUEST_METHOD == 'POST':
object.delete()
if not request.user.is_anonymous():
- request.user.add_message("The %s was deleted." % model._meta.verbose_name)
+ request.user.message_set.add(message="The %s was deleted." % model._meta.verbose_name)
return HttpResponseRedirect(post_delete_redirect)
else:
if not template_name:
Change History (4)
comment:1 by , 19 years ago
Cc: | added |
---|
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 19 years ago
<a href="http://allthemusic.siteburg.com">http://allthemusic.siteburg.com</a>
<a href="http://allthemusic.siteburg.com/music-site-myspacecom.html">http://allthemusic.siteburg.com/music-site-myspacecom.html</a>
<a href="http://allthemusic.siteburg.com/free-mp3-music-download.html">http://allthemusic.siteburg.com/free-mp3-music-download.html</a>
<a href="http://allthemusic.siteburg.com/buy-music-and-dvd-online.html">http://allthemusic.siteburg.com/buy-music-and-dvd-online.html</a>
<a href="http://allthemusic.siteburg.com/listen-to-free-music.html">http://allthemusic.siteburg.com/listen-to-free-music.html</a>
<a href="http://allthemusic.siteburg.com/country-music-market-share.html">http://allthemusic.siteburg.com/country-music-market-share.html</a>
<a href="http://allthemusic.siteburg.com/myspace-music-video-code.html">http://allthemusic.siteburg.com/myspace-music-video-code.html</a>
<a href="http://allthemusic.siteburg.com/radio-city-music-hall.html">http://allthemusic.siteburg.com/radio-city-music-hall.html</a>
<a href="http://allthemusic.siteburg.com/free-legal-music-download.html">http://allthemusic.siteburg.com/free-legal-music-download.html</a>
<a href="http://allthemusic.siteburg.com/free-music-video-code.html">http://allthemusic.siteburg.com/free-music-video-code.html</a>
<a href="http://allthemusic.siteburg.com/listen-to-music-online.html">http://allthemusic.siteburg.com/listen-to-music-online.html</a>
<a href="http://allthemusic.siteburg.com/free-ares-music-download.html">http://allthemusic.siteburg.com/free-ares-music-download.html</a>
<a href="http://allthemusic.siteburg.com/free-music-code-for-myspace.html">http://allthemusic.siteburg.com/free-music-code-for-myspace.html</a>
<a href="http://allthemusic.siteburg.com/free-music-download-site.html">http://allthemusic.siteburg.com/free-music-download-site.html</a>
<a href="http://allthemusic.siteburg.com/free-kazaa-music-download.html">http://allthemusic.siteburg.com/free-kazaa-music-download.html</a>
<a href="http://allthemusic.siteburg.com/download-free-music-video.html">http://allthemusic.siteburg.com/download-free-music-video.html</a>
<a href="http://allthemusic.siteburg.com/free-piano-sheet-music.html">http://allthemusic.siteburg.com/free-piano-sheet-music.html</a>
comment:4 by , 19 years ago
www.slav75.vzz.net
www.slav75.jktf.com
www.slav75.nipz.com
www.slav75.computed.net
www.slav75.gapgirls.com
www.slav75.saiyan.ws
www.slav75.saiyans.ws
(In [2317]) magic-removal: Fixed #1362 -- Fixed old-style DB API usage in create_update generic views.