do not display password in error
This commit is contained in:
parent
aa774cbce9
commit
c56cdcfa02
1 changed files with 10 additions and 3 deletions
|
|
@ -364,10 +364,17 @@ class ValueOptionError(_CommonError, ValueError):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
if ValueOptionError.tmpl is None:
|
if ValueOptionError.tmpl is None:
|
||||||
if kwargs.get("index") is None:
|
opt = kwargs.get('opt')
|
||||||
self.tmpl = _('"{0}" is an invalid {1} for {2}')
|
if opt and opt._do_not_display_value_in_error:
|
||||||
|
if kwargs.get("index") is None:
|
||||||
|
self.tmpl = _('{2} has an invalid {1}')
|
||||||
|
else:
|
||||||
|
self.tmpl = _('{2} at index "{3}" has an invalid {1}')
|
||||||
else:
|
else:
|
||||||
self.tmpl = _('"{0}" is an invalid {1} for {2} at index "{3}"')
|
if kwargs.get("index") is None:
|
||||||
|
self.tmpl = _('"{0}" is an invalid {1} for {2}')
|
||||||
|
else:
|
||||||
|
self.tmpl = _('"{0}" is an invalid {1} for {2} at index "{3}"')
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue