Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

StephaneMangin
Copy link
Member

No description provided.

@StephaneMangin StephaneMangin changed the title Update config.py New parameter i18n override Sep 3, 2024
@StephaneMangin StephaneMangin marked this pull request as draft September 3, 2024 14:30
Comment on lines +203 to +204
if not isinstance(override_translations, bool):
raise ParseError(u"'override_translations' key must be a boolean", YAML_EXAMPLE)
Copy link

@SilvioC2C SilvioC2C Sep 3, 2024

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:

Suggested change
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:

Suggested change
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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too soon bro' ^^

Copy link
Member Author

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

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 😄

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants