PEP-8 fixes

This commit is contained in:
Garret Wassermann 2018-12-20 21:30:23 -05:00
parent eee82015f7
commit a11c595a7c
2 changed files with 2 additions and 2 deletions

View File

@ -1060,7 +1060,7 @@ class KBItem(models.Model):
An item within the knowledgebase. Very straightforward question/answer
style system.
"""
voted_by= models.ManyToManyField(settings.AUTH_USER_MODEL)
voted_by = models.ManyToManyField(settings.AUTH_USER_MODEL)
category = models.ForeignKey(
KBCategory,
on_delete=models.CASCADE,

View File

@ -46,7 +46,7 @@ def vote(request, item):
item = get_object_or_404(KBItem, pk=item)
vote = request.GET.get('vote', None)
if vote in ('up', 'down'):
if request.user not in item.voted_by:
if request.user not in item.voted_by:
item.votes += 1
if vote == 'up':