Skip to content

Commit

Permalink
Remoce whitespaces to make the code flake8 compliant.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiabhi94 committed May 13, 2020
1 parent 736b1fe commit 2c4243c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions comment/models/reactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Reaction(models.Model):

objects = models.Manager()
comment_objects = ReactionManager()

def _increase_likes(self):
"""Increase likes and save the model"""
self.likes = models.F('likes') + 1
Expand Down Expand Up @@ -49,7 +49,7 @@ def _increase_reaction_count(self, reaction):
Args:
reaction (int): The integral value that matches to the reaction value in
the database
Returns:
None
"""
Expand Down
5 changes: 2 additions & 3 deletions comment/templatetags/comment_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,12 @@ def has_reacted(comment_and_user, reaction):
reaction_type = getattr(ReactionInstance.ReactionType, reaction.upper(), None)
if not reaction_type:
raise template.TemplateSyntaxError(
'Reaction must be an valid ReactionManager.RelationType. {} is not'.format(reaction)
)
'Reaction must be an valid ReactionManager.RelationType. {} is not'.format(reaction)
)
return ReactionInstance.objects.filter(
user=user,
reaction_type=reaction_type.value,
reaction__comment=comment
).exists()

return False

4 changes: 2 additions & 2 deletions comment/views/reactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def react(request, comment_id, reaction):
request (WSGI object): [description]
comment_id (int): primary key of the comment that needs to record comment.
reaction (str): the reaction to be recorded
"""
"""
if not request.is_ajax():
return HttpResponseBadRequest('Only AJAX request are allowed')

Expand All @@ -31,6 +31,6 @@ def react(request, comment_id, reaction):
'status': 0,
'likes': comment.likes,
'dislikes': comment.dislikes,
'msg': _('Your action has been updated successfully')
'msg': _('Your action has been updated successfully')
})
return JsonResponse(response)

0 comments on commit 2c4243c

Please sign in to comment.