Make blog_post_listing easier to read
authorJessica Tallon <jessica@megworld.co.uk>
Tue, 19 Aug 2014 13:03:53 +0000 (14:03 +0100)
committerJessica Tallon <jessica@megworld.co.uk>
Tue, 19 Aug 2014 13:30:45 +0000 (14:30 +0100)
This is Elronds change on #948. As 'blog_slug' is always
set in request.matchdict there is no need to do a default-none
get on the dictionary. This change just makes it easier to read.

mediagoblin/media_types/blog/views.py

index 62806c3cfb45b0cf56c11eb48e3e5bf7f41ee044..088164b90b3232646491506c842b52458bea00fb 100644 (file)
@@ -259,7 +259,7 @@ def blog_post_listing(request, page, url_user=None):
     """
     Page, listing all the blog posts of a particular blog.
     """
-    blog_slug = request.matchdict.get('blog_slug', None)
+    blog_slug = request.matchdict['blog_slug']
     blog = get_blog_by_slug(request, blog_slug, author=url_user.id)
     if not blog:
         return render_404(request)