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

Ensure unicode objects are not casted to str but properly encoded #1388

Merged
merged 2 commits into from Jan 22, 2018
Merged

Ensure unicode objects are not casted to str but properly encoded #1388

merged 2 commits into from Jan 22, 2018

Conversation

noirbizarre
Copy link
Contributor

More fixes on unicode handling (Remove a double translation and ensure lazy_string are properly encoded in search facets)

Connects to #1381

CHANGELOG.md Outdated
@@ -7,6 +7,7 @@
- `ValueError`s are not hidden anymore by the Bad Request error page, they are logged. [#1382](https://github.com/opendatateam/udata/pull/1382)
- Spatial encoding fixes: prevent breaking unicode errors. [#1381](https://github.com/opendatateam/udata/pull/1381)
- Ensure the multiple term search uses a `AND` operator [#1384](https://github.com/opendatateam/udata/pull/1384)
- Facets encoding fixes: ensure lazy string are propery encoded. [#1388](https://github.com/opendatateam/udata/pull/1388)
Copy link
Contributor

Choose a reason for hiding this comment

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

s/string/strings/ or s/are/is/

@@ -8,7 +8,7 @@
from werkzeug import cached_property

from udata.app import cache
from udata.i18n import gettext as _, get_locale, language
from udata.i18n import gettext as _, lazy_gettext as L_, get_locale, language
Copy link
Contributor

Choose a reason for hiding this comment

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

Is L_ a known convention? I'd be more comfortable with l_ since it's a function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is, already used for ngettext, pgettext.
I can make the same for lazy_gettext, ie. define it permanently into i18n.py instead of using import .. as

@noirbizarre noirbizarre merged commit c3faf2d into opendatateam:master Jan 22, 2018
@noirbizarre noirbizarre deleted the fix-unicode-errors-in-search branch January 22, 2018 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants