Correction for new blog system
This commit is contained in:
@@ -203,7 +203,7 @@ def view_internal():
|
||||
id=0
|
||||
if list_posts != None:
|
||||
for post in list_posts:
|
||||
posts = [dict(title_id=[0], title=post[1], subtitle=post[2], content=post[3], creation_date=post[4], last_updated=post[5], author=post[6], status=post[7] )] + posts
|
||||
posts = [dict(title_id=post[0], title=post[1], subtitle=post[2], content=post[3], creation_date=post[4], last_updated=post[5], author=post[6], status=post[7] )] + posts
|
||||
else:
|
||||
return redirect(BASE_URL, code=404)
|
||||
|
||||
@@ -231,7 +231,7 @@ def viewuser(author):
|
||||
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
if 'username' in session :
|
||||
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status != 'draft' """, (author,))
|
||||
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status!='draft' """, (author,))
|
||||
else:
|
||||
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status='public' OR status='public_unified' """, (author,))
|
||||
list_posts=cursor.fetchall()
|
||||
@@ -260,7 +260,7 @@ def viewauthorrss(author):
|
||||
if list_posts != None:
|
||||
last_build=last_article_date[0]
|
||||
for post in list_posts:
|
||||
posts=[dict(title_id[0], title=post[1], subtitle=post[2], content=markdown(post[3], extensions=MARKDOWN_EXT), creation_date=post[4],
|
||||
posts=[dict(title_id=post[0], title=post[1], subtitle=post[2], content=markdown(post[3], extensions=MARKDOWN_EXT), creation_date=post[4],
|
||||
author=post[5], status=post[6])] + posts
|
||||
|
||||
return render_template('blog_rss.xml',
|
||||
@@ -285,7 +285,7 @@ def viewPrivateArticle(username, title_id):
|
||||
content = markdown(post[3], extensions=MARKDOWN_EXT)
|
||||
return render_template('blog.html', post_info=post_info, content=content)
|
||||
else:
|
||||
return redirect(url_for('blog'), code=404)
|
||||
return redirect(url_for('login'), code=404)
|
||||
|
||||
|
||||
@blog.route('/blog/public_unified/<username>/<title_id>', methods=['GET'])
|
||||
|
||||
Reference in New Issue
Block a user