forms: fix creation of captcha answer when using translations (#54368)
This commit is contained in:
parent
c392804608
commit
77dfc9411a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue