-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New parameter i18n override #75
Conversation
if not isinstance(override_translations, bool): | ||
raise ParseError(u"'override_translations' key must be a boolean", YAML_EXAMPLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checks are failing because the method receives None
for override_translations
, and the instance check against bool
type fails.
Maybe you can normalize the variable before the check like this:
if not isinstance(override_translations, bool): | |
raise ParseError(u"'override_translations' key must be a boolean", YAML_EXAMPLE) | |
override_translations = override_translations or False | |
if not isinstance(override_translations, bool): | |
raise ParseError(u"'override_translations' key must be a boolean", YAML_EXAMPLE) |
or:
if not isinstance(override_translations, bool): | |
raise ParseError(u"'override_translations' key must be a boolean", YAML_EXAMPLE) | |
if override_translations not in (None, True, False): | |
raise ParseError(u"'override_translations' key must be None or a boolean", YAML_EXAMPLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too soon bro' ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But comment taken in account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was waiting for a DB migration to complete and I saw this PR, so I took the chance to give it a read even if it was in draft 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nexyt PR, the good one ^^ #76
No description provided.