Skip to content
This repository was archived by the owner on Aug 27, 2020. It is now read-only.

Conversation

@djanku
Copy link

@djanku djanku commented Oct 21, 2014

I've inserted return conditions in "gettext" family functions by reason of cause exceptions in flask-wtf extensions library. For example, Flask-WTF passing arguments to string after translation (in Length validator):

message = field.gettext('Field must be between %(min)d and %(max)d characters long.')
raise ValidationError(message % dict(min=self.min, max=self.max, length=l))

This cause KeyError exception, because "some string with %(arg)d" % {} is invoked. We need translated string primarily.

I've inserted return conditions in "gettext" family functions by reason of cause exceptions in flask-wtf extensions library. For example, Flask-WTF passing arguments to string after translation (in Length validator):

message = field.gettext('Field must be between %(min)d and %(max)d characters long.')
raise ValidationError(message % dict(min=self.min, max=self.max, length=l))

This cause KeyError exception, because "some string with %(arg)d" % {} is invoked. We need translated string primarily.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant