You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users should be allowed to like or unlike comments.
In dens.py you might want to change get_likes() to something like...
# Returns the number of likes by post_iddefget_likes(id, type):
iftype=='post':
likes=get_db().execute(''' SELECT COUNT(*) AS COUNT FROM post_like_assoc WHERE post_id = ?; ''', (id,)).fetchone()
returnlikes['count']
eliftype=='comment':
# ... return the likes for a specific comment ...
as well as update every time get_likes is called elsewhere...
The text was updated successfully, but these errors were encountered:
Users should be allowed to like or unlike comments.
In
dens.py
you might want to changeget_likes()
to something like...as well as update every time
get_likes
is called elsewhere...The text was updated successfully, but these errors were encountered: