Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
handle null timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
jbremer committed Mar 4, 2015
1 parent edc82be commit bd62582
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions utils/db_migration/versions/from_1_1_to_1_2-added_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,35 @@ def _perform(upgrade):
d["platform"] = item[9]
d["memory"] = item[10]
d["enforce_timeout"] = item[11]

if isinstance(item[12], datetime):
d["clock"] = item[12]
else:
elif item[12]:
d["clock"] = parse(item[12])
else:
d["clock"] = None

if isinstance(item[13], datetime):
d["added_on"] = item[13]
else:
elif item[13]:
d["added_on"] = parse(item[13])
else:
d["added_on"] = None

if isinstance(item[14], datetime):
d["started_on"] = item[14]
else:
elif item[14]:
d["started_on"] = parse(item[14])
else:
d["started_on"] = None

if isinstance(item[15], datetime):
d["completed_on"] = item[15]
else:
elif item[15]:
d["completed_on"] = parse(item[15])
else:
d["completed_on"] = None

d["status"] = item[16]
d["sample_id"] = item[17]

Expand Down

0 comments on commit bd62582

Please sign in to comment.