Skip to content

Commit

Permalink
edited blogs/views
Browse files Browse the repository at this point in the history
  • Loading branch information
Anupamaraie committed Nov 4, 2023
1 parent 37a8490 commit 4fcf8e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blogs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ def post(self, request, post_id):

like_exists = Likes.objects.filter(user=user, post=post).exists()
if like_exists:
return cr.success(message='You have already liked this post.')
return cr.success(message="You have already liked this post.")

like = Likes(user=user, post=post)
like.save()
return cr.success(message='Post liked successfully.')
return cr.success(message="Post liked successfully.")

def delete(self, request, post_id):
post = Posts.objects.filter(post_id=post_id).first()
Expand All @@ -237,7 +237,7 @@ def delete(self, request, post_id):

like = Likes.objects.filter(user=user, post=post).first()
if not like:
return cr.success(message='You have not liked this post.')
return cr.success(message="You have not liked this post.")

like.delete()
return cr.success(message='Like removed successfully.')
return cr.success(message="Like removed successfully.")

0 comments on commit 4fcf8e0

Please sign in to comment.