fixed redirect view

This commit is contained in:
James Turk 2010-04-07 17:07:41 -04:00
parent d65e992cd7
commit 7752e62dce

View File

@ -176,12 +176,11 @@ def rename(request, title):
''' POST-only view to rename article '''
article = get_object_or_404(Article, title=title)
new_title = request.POST['new_title']
article.title = new_title
print new_title
article.title = new_title.replace(' ', '_')
article.save()
new_article = Article.objects.create(title=title, creator=request.user,
redirect_to=article)
return redirect(new_article)
return redirect(article)
@title_check
def article_history(request, title):