Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unicode: Fixed #4495 -- Fixed a used of str() in the "firstof" templa…

…te tag.

Patch from Ivan Sagalaev.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5446 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 322c3e14546cde4ff2656666b7b5088f3bcb5c26 1 parent b43ecd8
@malcolmt malcolmt authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/template/defaulttags.py
View
6 django/template/defaulttags.py
@@ -4,7 +4,7 @@
from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END
from django.template import get_library, Library, InvalidTemplateLibrary
from django.conf import settings
-from django.utils.encoding import smart_str
+from django.utils.encoding import smart_str, smart_unicode
import sys
import re
@@ -59,8 +59,8 @@ def render(self, context):
except VariableDoesNotExist:
continue
if value:
- return str(value)
- return ''
+ return smart_unicode(value)
+ return u''
class ForNode(Node):
def __init__(self, loopvars, sequence, reversed, nodelist_loop):
Please sign in to comment.
Something went wrong with that request. Please try again.