Fix pagevote and bookmark bug for new objects

This commit is contained in:
cuom1999 2023-08-03 23:19:45 +07:00
parent 36e27321f7
commit 4ceae6d066
7 changed files with 32 additions and 44 deletions

View file

@ -101,6 +101,5 @@ class PageVoteDetailView(TemplateResponseMixin, SingleObjectMixin, View):
def get_context_data(self, **kwargs):
context = super(PageVoteDetailView, self).get_context_data(**kwargs)
queryset = self.object.pagevote
context["pagevote"] = queryset.first()
context["pagevote"] = self.object.get_or_create_pagevote()
return context