Opened 8 years ago

Closed 7 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: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 7 years ago by Karen Tracey <kmtracey@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Dup of #3146, which has been fixed.

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