Fix error in blog edit view.
authorAditi <aditi.iitr@gmail.com>
Mon, 29 Jul 2013 07:57:30 +0000 (13:27 +0530)
committerAditi <aditi.iitr@gmail.com>
Mon, 29 Jul 2013 07:57:30 +0000 (13:27 +0530)
mediagoblin/media_types/blog/views.py

index b353b690c9522070b4a75b6ab1cc033435955d00..1d7788cb3ca15a6296c1a5941aceeb1180111d73 100644 (file)
@@ -167,11 +167,8 @@ def blogpost_create(request):
 def blogpost_edit(request):
     blog_slug = request.matchdict.get('blog_slug', None)
     blog_post_slug = request.matchdict.get('blog_post_slug', None)
-
+    blogpost = request.db.MediaEntry.query.filter_by(slug=blog_post_slug, uploader=request.user.id).first()
     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()
-
-    blogpost = blog_post_data.get_media_entry
 
     defaults = dict(
                 title = blogpost.title,