def METHOD_NAME(self, context):
    try:
        context["poll"] = Poll.objects.current_poll()
    except Poll.DoesNotExist:
        context["poll"] = (
            Poll.objects.exclude(is_user_poll=True)
            .order_by("-publication_date")
            .first()
        )
    if self.request.user.is_authenticated and context["poll"] is not None:
        context["poll_has_voted"] = context["poll"].user_has_voted(
            self.request.user
        )