diff --git a/db/moona_data.db b/db/moona_data.db index 5c549ad..d7fb9ae 100644 Binary files a/db/moona_data.db and b/db/moona_data.db differ diff --git a/main.py b/main.py index 0deba8c..d63ded5 100644 --- a/main.py +++ b/main.py @@ -112,8 +112,9 @@ def publications(): like = session.query(Like).filter(Like.post == i.id).all() if like: emotion['like'] = len(like) - if session.query(Like).filter(Like.post == i.id, Like.user == current_user.id).first(): - emotion['is_like'] = 1 + if current_user.is_authenticated: + if session.query(Like).filter(Like.post == i.id, Like.user == current_user.id).first(): + emotion['is_like'] = 1 emotion_fresh.append(emotion) return render_template('publications.html', fresh_post=fresh_posts, emotion_fresh=emotion_fresh, title='moona') diff --git a/templates/publications.html b/templates/publications.html index b117862..eacb562 100644 --- a/templates/publications.html +++ b/templates/publications.html @@ -56,6 +56,7 @@
{% endif %} + {% if current_user.is_authenticated %} + {% endif %} {% if emotion_fresh[loop.index0]['link'] != None %}