fix typo
This commit is contained in:
parent
6e72c08ef4
commit
a447cdfcf1
5 changed files with 9 additions and 19 deletions
|
@ -101,11 +101,8 @@ class PageVoteDetailView(TemplateResponseMixin, SingleObjectMixin, View):
|
|||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(PageVoteDetailView, self).get_context_data(**kwargs)
|
||||
queryset = PageVote.objects.filter(page=self.get_comment_page())
|
||||
if queryset.exists() == False:
|
||||
pagevote = PageVote(page=self.get_comment_page(), score=0)
|
||||
pagevote.save()
|
||||
context["pagevote"] = queryset.first()
|
||||
queryset = PageVote.objects.get_or_create(page=self.get_comment_page())
|
||||
context["pagevote"] = queryset[0]
|
||||
return context
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue