Merge branch 'develop' into bootstrap4

This commit is contained in:
Garret Wassermann
2018-12-15 14:03:52 -05:00
3 changed files with 72 additions and 4 deletions

View File

@ -47,9 +47,11 @@ def vote(request, item):
item = get_object_or_404(KBItem, pk=item)
vote = request.GET.get('vote', None)
if vote in ('up', 'down'):
item.votes += 1
if vote == 'up':
item.recommendations += 1
item.save()
if request.user not in item.voted_by:
item.votes += 1
if vote == 'up':
item.recommendations += 1
item.save()
return HttpResponseRedirect(item.get_absolute_url())