def _session_enrollment_latest_version(data): try: alternative, unused, enrollment_date, last_seen = data if last_seen: last_seen = fix_awareness(last_seen) except ValueError: # Data from previous version alternative, unused = data enrollment_date = None last_seen = None return alternative, unused, enrollment_date, last_seen
def _session_enrollment_latest_version(data): try: alternative, unused, enrollment_date, last_seen = data if isinstance(enrollment_date, numbers.Number): enrollment_date = datetime_from_timestamp(enrollment_date) if isinstance(last_seen, numbers.Number): last_seen = datetime_from_timestamp(last_seen) if last_seen: last_seen = fix_awareness(last_seen) except ValueError: # Data from previous version alternative, unused = data enrollment_date = None last_seen = None return alternative, unused, enrollment_date, last_seen