Skip to content

Commit

Permalink
magic-removal: Fixed #1362 -- Fixed old-style DB API usage in create_…
Browse files Browse the repository at this point in the history
…update generic views.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Feb 17, 2006
1 parent 3794280 commit 7e70c7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django/views/generic/create_update.py
Expand Up @@ -39,7 +39,7 @@ def create_object(request, model, template_name=None,
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.
Expand Down Expand Up @@ -110,7 +110,7 @@ def update_object(request, model, object_id=None, slug=None,
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:
Expand Down Expand Up @@ -177,7 +177,7 @@ def delete_object(request, model, post_delete_redirect,
if request.META['REQUEST_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:
Expand Down

0 comments on commit 7e70c7d

Please sign in to comment.