diff options
author | Felipe Reyes <freyes@suse.com> | 2014-07-16 17:50:03 +0200 |
---|---|---|
committer | Felipe Reyes <freyes@suse.com> | 2014-08-06 14:34:53 +0200 |
commit | af49cf1f156e68dcd8d34a3de59c40ee5bd12b66 (patch) | |
tree | 5ec16171b2eaedc5c95da3b5e4fe2042d8f351d8 /horizon/exceptions.py | |
parent | b4d0310807562b57b8df1acb8f74bc46ea776996 (diff) | |
download | horizon-af49cf1f156e68dcd8d34a3de59c40ee5bd12b66.tar.gz |
Replace force_unicode with force_text
Django changed the name to force_unicode and it's only available in
python2 as an alias of force_text. The new name is available since
Django 1.4.2
Closes-Bug: #1345642
Change-Id: Ida8c545ceec7c31999f2497d540a0dc5a653d286
Diffstat (limited to 'horizon/exceptions.py')
-rw-r--r-- | horizon/exceptions.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/horizon/exceptions.py b/horizon/exceptions.py index 673ef79ff..a1a7151f4 100644 --- a/horizon/exceptions.py +++ b/horizon/exceptions.py @@ -261,7 +261,7 @@ def handle(request, message=None, redirect=None, ignore=False, exc_type, exc_value, exc_traceback = exc_value.wrapped wrap = True - log_entry = encoding.force_unicode(exc_value) + log_entry = encoding.force_text(exc_value) # We trust messages from our own exceptions if issubclass(exc_type, HorizonException): @@ -271,9 +271,9 @@ def handle(request, message=None, redirect=None, ignore=False, message = exc_value._safe_message # If the message has a placeholder for the exception, fill it in elif message and "%(exc)s" in message: - message = encoding.force_unicode(message) % {"exc": log_entry} + message = encoding.force_text(message) % {"exc": log_entry} if message: - message = encoding.force_unicode(message) + message = encoding.force_text(message) if issubclass(exc_type, UNAUTHORIZED): if ignore: |