chore(misc): More idiomatic

This commit is contained in:
Tom Hubrecht 2024-07-10 13:52:24 +02:00
parent fd65aa36ad
commit 1ca85957d2
2 changed files with 20 additions and 25 deletions

View file

@ -1,27 +1,24 @@
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
MAIL_VOTERS = ( MAIL_VOTERS = """Dear {full_name},
"Dear {full_name},\n"
"\n"
"\n"
"Election URL: {election_url}\n"
"The election will take place from {start} to {end}.\n"
"\n"
"Your voter ID: {username}\n"
"Your password: {password}\n"
"\n"
"-- \n"
"Kadenios"
)
MAIL_VOTE_DELETED = ( Election URL: {election_url}
"Dear {full_name},\n" The election will take place from {start} to {end}.
"\n"
"Your vote for {election_name} has been removed." Your voter ID: {username}
"\n" Your password: {password}
"-- \n"
"Kadenios" --
) Kadenios
"""
MAIL_VOTE_DELETED = """Dear {full_name},
Your vote for {election_name} has been removed.
--
Kadenios
"""
QUESTION_TYPES = [ QUESTION_TYPES = [
("assentiment", _("Assentiment")), ("assentiment", _("Assentiment")),

View file

@ -5,7 +5,5 @@
def choices_length(choices): def choices_length(choices):
"""Renvoie la longueur maximale des choix de choices""" """Renvoie la longueur maximale des choix de choices"""
m = 0
for c in choices: return max(len(c[0]) for c in choices)
m = max(m, len(c[0]))
return m