Skip to content

vote Template Names

Redirect template if user is not logged or has already voted.

nonauth_user_template_name(poll)

Name of template to display if user is not authorized to perform a vote

Source code in apps/votes_results/classes/vote/vote_template_names.py
 4
 5
 6
 7
 8
 9
10
11
def nonauth_user_template_name(poll: PollModel) -> str:
    """Name of template to display if user is not 
    authorized to perform a vote"""

    if poll.is_votable_google():
        return 'global/login.html'

    return 'polls_management/token_poll_redirect.html'