forms: fix creation of captcha answer when using translations (#54368)

This commit is contained in:
Frédéric Péters 2021-05-28 10:29:36 +02:00
parent c392804608
commit 77dfc9411a
1 changed files with 3 additions and 3 deletions

View File

@ -1610,11 +1610,11 @@ class CaptchaWidget(CompositeWidget):
operator = random.choice([_('plus'), _('minus')])
else:
operator = random.choice([_('times'), _('plus'), _('minus')])
if operator == 'times':
if operator == _('times'):
answer = a * b
elif operator == 'plus':
elif operator == _('plus'):
answer = a + b
elif operator == 'minus':
elif operator == _('minus'):
if b > a:
a, b = b, a
answer = a - b