Commit d984e9e8 authored by Mathis Dedial's avatar Mathis Dedial
Browse files

Another fix for 'unlike' button

parent 26046925
Pipeline #2733 passed with stage
in 18 seconds
......@@ -23,7 +23,13 @@ def index():
'LEFT JOIN vote AS vote_2 ON vote_2.burger_id=burger.id AND vote_2.nethz= :nethz '
'GROUP BY burger.id '
'ORDER BY vote_count DESC, timestamp')
burger_list = db.engine.execute(querystring, nethz=session['user']).fetchall()
# Display, which burgers have already been liked
if 'user' in session:
burger_list = db.engine.execute(querystring, nethz=session['user']).fetchall()
else:
burger_list = db.engine.execute(querystring, nethz='').fetchall()
return render_template('vote.html',
burger_list=burger_list,
bread=BREAD,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment