Commit d5aa9c7e authored by Vincent Le gallic's avatar Vincent Le gallic

Le linter avait raison sur quelques points

Mais sinon, faites gaffes à ce que vous faites, scrogneugneu !
parent 20cf1bb5
......@@ -492,8 +492,8 @@ class CreditRetraitForm(MoneyForm):
("especes", _(u"Espèces")),
("cb", _(u"Carte bancaire")),
("cheque", _(u"Chèque")),
("virement", _(u"Virement bancaire")),]
)
("virement", _(u"Virement bancaire")),
])
nom = forms.CharField(label=_(u"Nom"), required=False, widget=forms.TextInput(attrs={"autocomplete" : "off"}))
prenom = forms.CharField(label=_(u"Prénom"), required=False, widget=forms.TextInput(attrs={"autocomplete" : "off"}))
banque = forms.CharField(label=_(u"Banque"), required=False)
......@@ -742,7 +742,8 @@ class WEIVieuxForm(BootstrapForm):
class WEIVieuxChangeForm(WEIVieuxForm):
bus = forms.ChoiceField(choices=BUS, initial=_(u'Je ne sais pas'), required=True, label=_(u"Bus demandé"))
Q_RADIO = [(i,i) for i in range(1,6)]
Q_RADIO = [(i, i) for i in range(1, 6)]
Q_MOTS = (
('0', _(u'Incognito')),
......@@ -923,18 +924,19 @@ class AjoutRemise(BootstrapForm):
out['idremise'] = int(out['idremise'])
_latex_escape = {
'&' : r'\&',
'%': r'\%',
'$': r'\$',
'#': r'\#',
'_': r'\_',
'{': r'\{',
'}': r'\}',
'[': r'\[',
']': r'\]',
'~': r'\textasciitilde',
'\\': r'\textbackslash',
}
'&': r'\&',
'%': r'\%',
'$': r'\$',
'#': r'\#',
'_': r'\_',
'{': r'\{',
'}': r'\}',
'[': r'\[',
']': r'\]',
'~': r'\textasciitilde',
'\\': r'\textbackslash',
}
def escape_latex(s):
return "".join(_latex_escape.get(c, c) for c in s)
......@@ -962,8 +964,8 @@ class FactureForm(BootstrapForm):
""" Formate les champs adresse et description
pour le rendu dans le LaTeX."""
out = super(FactureForm, self).clean()
out["objet"] = escape_latex(out["objet"])
out["nom"] = escape_latex(out["nom"])
out["objet"] = escape_latex(out["objet"])
out["nom"] = escape_latex(out["nom"])
if out.has_key("adresse"):
out["adresse"] = out["adresse"].strip().split('\n')
if out.has_key("description"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment