Skip to content

Commit

Permalink
Fix unicode in lazy translations.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkuty committed Apr 28, 2016
1 parent 787d9da commit 53ebc39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion horizon_contrib/forms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.utils.translation import ugettext_lazy as _
from horizon import forms, messages
from horizon_contrib.forms.models import create_or_update_and_get
from django.utils.encoding import smart_unicode

try:
from crispy_forms.helper import FormHelper
Expand Down Expand Up @@ -148,7 +149,7 @@ def handle(self, request, data):
try:
messages.success(
request,
_("Model %s was successfuly saved." % saved_model))
_(smart_unicode("Model %s was successfuly saved." % saved_model)))
except Exception as e:
raise e
# swallowed Exception
Expand Down

2 comments on commit 53ebc39

@chenull
Copy link

@chenull chenull commented on 53ebc39 May 6, 2016

Choose a reason for hiding this comment

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

Hi, according to https://docs.djangoproject.com/en/1.9/topics/python3/, it is better to use smart_text than smart_unicode

Excerpt:

Old name New name
smart_str smart_bytes
smart_unicode smart_text
force_unicode force_text

@michaelkuty
Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks man, I've miss this because we are still on 1.8 👍

Please sign in to comment.