Projet

Général

Profil

0001-forms-fix-creation-of-captcha-answer-when-using-tran.patch

Frédéric Péters, 01 juin 2021 08:58

Télécharger (1,11 ko)

Voir les différences:

Subject: [PATCH] forms: fix creation of captcha answer when using translations
 (#54368)

 wcs/qommon/form.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
wcs/qommon/form.py
1610 1610
                operator = random.choice([_('plus'), _('minus')])
1611 1611
            else:
1612 1612
                operator = random.choice([_('times'), _('plus'), _('minus')])
1613
            if operator == 'times':
1613
            if operator == _('times'):
1614 1614
                answer = a * b
1615
            elif operator == 'plus':
1615
            elif operator == _('plus'):
1616 1616
                answer = a + b
1617
            elif operator == 'minus':
1617
            elif operator == _('minus'):
1618 1618
                if b > a:
1619 1619
                    a, b = b, a
1620 1620
                answer = a - b
1621
-