Patch for badge migrations to fix date specificity change.

This commit is contained in:
Jonathan Piacenti
2016-03-22 16:45:01 +00:00
parent 1a6394b781
commit ca959ab1d1

View File

@@ -60,7 +60,8 @@ def forwards(apps, schema_editor):
assertion.save()
# Would be overwritten by the first save.
assertion.created = datetime.fromtimestamp(
time.mktime(time.strptime(badge.data['created_at'], "%Y-%m-%dT%H:%M:%S"))
# Later versions of badgr include microseconds, but they aren't certain to be there.
time.mktime(time.strptime(badge.data['created_at'].split('.')[0], "%Y-%m-%dT%H:%M:%S"))
)
assertion.save()