Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added datetime.date to the things ignored by strings_only in [6406].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6567 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b7687fae2d04c3cee88b0c707f9f2c2176e3f515 1 parent d1efe9b
Malcolm Tredinnick authored October 20, 2007

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/utils/encoding.py
2  django/utils/encoding.py
@@ -31,7 +31,7 @@ def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'):
31 31
 
32 32
     If strings_only is True, don't convert (some) non-string-like objects.
33 33
     """
34  
-    if strings_only and isinstance(s, (types.NoneType, int, long, datetime.datetime, datetime.time, float)):
  34
+    if strings_only and isinstance(s, (types.NoneType, int, long, datetime.datetime, datetime.date, datetime.time, float)):
35 35
         return s
36 36
     if not isinstance(s, basestring,):
37 37
         if hasattr(s, '__unicode__'):

0 notes on commit b7687fa

Please sign in to comment.
Something went wrong with that request. Please try again.