Code

Ticket #3146: unicode_strftime_fix.diff

File unicode_strftime_fix.diff, 479 bytes (added by deepak <deep.thukral@…>, 7 years ago)
Line 
1Index: __init__.py
2===================================================================
3--- __init__.py (revision 6172)
4+++ __init__.py (working copy)
5@@ -537,7 +537,7 @@
6 
7     def get_db_prep_save(self, value):
8         # Casts dates into string format for entry into database.
9-        if value is not None:
10+        if value is not None and hasattr(value, 'strftime'):
11             value = value.strftime('%Y-%m-%d')
12         return Field.get_db_prep_save(self, value)
13