Opened 17 years ago

Closed 17 years ago

#5322 closed (duplicate)

Casting string to DateTime object does not check for existence of strftime.

Reported by: pradeep.gowda@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Similar to #2192

patch :

Index: __init__.py
===================================================================
--- __init__.py (revision 6022)
+++ __init__.py (working copy)
@@ -534,7 +534,7 @@
 
     def get_db_prep_save(self, value):
         # Casts dates into string format for entry into database.
-        if value is not None:
+        if value is not None and hasattr(value, 'strftime'):
             value = value.strftime('%Y-%m-%d')
         return Field.get_db_prep_save(self, value)

Change History (1)

comment:1 by Karen Tracey <kmtracey@…>, 17 years ago

Resolution: duplicate
Status: newclosed

Dup of #3146, which has been fixed.

Note: See TracTickets for help on using tickets.
Back to Top