exports: Refactor event_time to export_time timestamp.

The time of the event was incorrectly being sent
as a datetime object.
This commit is contained in:
Wyatt Hoodes 2019-08-08 09:46:44 -10:00 committed by Tim Abbott
parent e0cf3d0e76
commit 7a2a1f29ad
2 changed files with 3 additions and 3 deletions

View File

@ -1709,7 +1709,7 @@ def get_realm_exports_serialized(user: UserProfile) -> List[Dict[str, Any]]:
for export in all_exports:
exports_dict[export.id] = dict(
id=export.id,
event_time=export.event_time.ctime(),
export_time=export.event_time.timestamp(),
acting_user_id=export.acting_user.id,
extra_data=ujson.loads(export.extra_data)
)

View File

@ -2763,13 +2763,13 @@ class EventsRegisterTest(ZulipTestCase):
('type', equals('realm_export')),
('exports', check_list(check_dict_only([
('id', check_int),
('event_time', check_string),
('export_time', check_float),
('acting_user_id', check_int),
('extra_data', check_dict_only([
('export_path', check_string),
('deleted_timestamp', equals(None))
])),
])))
]))),
])
do_change_is_admin(self.user_profile, True)