fixed redirect view
This commit is contained in:
parent
d65e992cd7
commit
7752e62dce
@ -176,12 +176,11 @@ def rename(request, title):
|
|||||||
''' POST-only view to rename article '''
|
''' POST-only view to rename article '''
|
||||||
article = get_object_or_404(Article, title=title)
|
article = get_object_or_404(Article, title=title)
|
||||||
new_title = request.POST['new_title']
|
new_title = request.POST['new_title']
|
||||||
article.title = new_title
|
article.title = new_title.replace(' ', '_')
|
||||||
print new_title
|
|
||||||
article.save()
|
article.save()
|
||||||
new_article = Article.objects.create(title=title, creator=request.user,
|
new_article = Article.objects.create(title=title, creator=request.user,
|
||||||
redirect_to=article)
|
redirect_to=article)
|
||||||
return redirect(new_article)
|
return redirect(article)
|
||||||
|
|
||||||
@title_check
|
@title_check
|
||||||
def article_history(request, title):
|
def article_history(request, title):
|
||||||
|
Loading…
Reference in New Issue
Block a user