Correct timezone data from old portal scrape

This commit is contained in:
Tanner Collin 2020-01-16 09:46:11 +00:00
parent b6573f1d72
commit ec5f17d4d3

View File

@ -62,7 +62,7 @@ SESSION_FIELDS = [
'id',
# course_id -> course
# instructor -> old_instructor
'datetime',
# datetime -> fix timezone
'cost',
]
@ -173,6 +173,7 @@ for o in old:
new[f] = o.__dict__.get(f, None)
new['course'] = models.Course.objects.get(id=o.course_id)
new['old_instructor'] = o.instructor
new['datetime'] = str(o.datetime).replace('Z', '-07:00')
models.Session.objects.create(**new)
print('Imported session #{} - {} {}'.format(