Fix blog extraction for get and post both type of requests.
This commit is contained in:
parent
0ccfedf8a1
commit
bed960cba9
@ -85,10 +85,10 @@ def blog_edit(request):
|
||||
user=request.user.username)
|
||||
|
||||
|
||||
|
||||
#Blog already exists.
|
||||
else:
|
||||
if request.method == 'GET':
|
||||
blog = Blog.query.filter_by(slug=blog_slug).first()
|
||||
if request.method == 'GET':
|
||||
defaults = dict(
|
||||
title = blog.title,
|
||||
description = blog.description,
|
||||
@ -121,6 +121,9 @@ def blogpost_create(request):
|
||||
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()
|
||||
@ -225,5 +228,3 @@ def blog_dashboard(request):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user