queue_processors: Clean up the extra_data dict code.

We don't want to add a `deleted_timestamp` key until
the export is actually deleted.
This commit is contained in:
Wyatt Hoodes 2019-08-11 08:17:16 -10:00 committed by Tim Abbott
parent 6f6efa516d
commit 7d178bbb0f
2 changed files with 4 additions and 4 deletions

View File

@ -2767,7 +2767,6 @@ class EventsRegisterTest(ZulipTestCase):
('acting_user_id', check_int),
('export_data', check_dict_only([
('export_path', check_string),
('deleted_timestamp', equals(None))
])),
]))),
])

View File

@ -619,10 +619,11 @@ class DeferredWorker(QueueProcessingWorker):
delete_after_upload=True)
assert public_url is not None
# Store the relative URL of the export.
# Update the extra_data field now that the export is complete.
export_event = RealmAuditLog.objects.get(id=event['id'])
export_event.extra_data = ujson.dumps({'export_path': urllib.parse.urlparse(public_url).path,
'deleted_timestamp': None})
export_event.extra_data = ujson.dumps(dict(
export_path=urllib.parse.urlparse(public_url).path,
))
export_event.save(update_fields=['extra_data'])
# Send a private message notification letting the user who