user=request.user.username)
-
+ #Blog already exists.
else:
+ blog = Blog.query.filter_by(slug=blog_slug).first()
if request.method == 'GET':
- blog = Blog.query.filter_by(slug=blog_slug).first()
defaults = dict(
title = blog.title,
description = blog.description,
form = blog_forms.BlogPostEditForm(request.form, license=request.user.license_preference)
-
+
if request.method == 'POST' and form.validate():
+
+ _log.info(request.form['status'])
+
blog_slug = request.matchdict.get('blog_slug')
blog = request.db.Blog.query.filter_by(slug=blog_slug,
author=request.user.id).first()
'blog_slug':blog_slug,
'blog':blog,
'blog_post_count':blog_post_count
- })
-
-
+ })