From: Aditi Date: Mon, 29 Jul 2013 05:38:03 +0000 (+0530) Subject: Change Redirect url to blog dashboard in blog_edit view. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8f6a0bf44e83bab9b0d2c4dc9177a8f28b7fb19c;p=mediagoblin.git Change Redirect url to blog dashboard in blog_edit view. --- diff --git a/mediagoblin/media_types/blog/views.py b/mediagoblin/media_types/blog/views.py index 91688f09..b353b690 100644 --- a/mediagoblin/media_types/blog/views.py +++ b/mediagoblin/media_types/blog/views.py @@ -77,8 +77,9 @@ def blog_edit(request): blog.generate_slug() blog.save() - return redirect(request, "mediagoblin.user_pages.user_home", - user=request.user.username) + return redirect(request, "mediagoblin.media_types.blog.blog-dashboard", + user=request.user.username, + blog_slug=blog.slug) else: add_message(request, ERROR, "You can not create any more blogs") return redirect(request, "mediagoblin.user_pages.user_home", @@ -111,8 +112,9 @@ def blog_edit(request): blog.save() add_message(request, SUCCESS, "Your blog is updated.") - return redirect(request, "mediagoblin.user_pages.user_home", - user=request.user.username) + return redirect(request, "mediagoblin.media_types.blog.blog-dashboard", + user=request.user.username, + blog_slug=blog.slug) @require_active_login def blogpost_create(request): @@ -163,8 +165,8 @@ def blogpost_create(request): @require_active_login def blogpost_edit(request): - blog_slug = request.matchdict.get('blog_slug') - blog_post_slug = request.matchdict.get('blog_post_slug') + blog_slug = request.matchdict.get('blog_slug', None) + blog_post_slug = request.matchdict.get('blog_post_slug', None) blog = request.db.Blog.query.filter_by(slug=blog_slug, author=request.user.id).first() blog_post_data = request.db.BlogPostData.query.filter_by(blog=blog.id).first()