Skip to content

Commit

Permalink
[model][xs] Cope with sqlite on my machine returns a datetime instead…
Browse files Browse the repository at this point in the history
… of a string.
  • Loading branch information
Ross Jones committed Dec 5, 2011
1 parent 74ffe3d commit db8cccc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/model/types.py
Expand Up @@ -85,7 +85,7 @@ def iso_date_to_datetime_for_sqlite(datetime_or_iso_date_if_sqlite):
# to call this to convert it into a datetime type. When running on
# postgres then you have a datetime anyway, so this function doesn't
# do anything.
if meta.engine_is_sqlite():
if meta.engine_is_sqlite() and isinstance(datetime_or_iso_date_if_sqlite, basestring):
return datetime.datetime.strptime(datetime_or_iso_date_if_sqlite,
'%Y-%m-%d %H:%M:%S.%f')
else:
Expand Down

0 comments on commit db8cccc

Please sign in to comment.