mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 19:13:53 +00:00
export: Create REALM_EXPORTED audit log for exports via shell.
Earlier, we were creating RealmAuditLog with REALM_EXPORTED event_type when export of public data took place via organization settings panel. We were not creating the audit log when the export was executed via shell i.e './manage.py export'. This commit creates the audit log in that case too. It will help during import to distinguish readily between imports from another Zulip server vs imports from another product.
This commit is contained in:
committed by
Tim Abbott
parent
cf24d2c25e
commit
cc793612f0
@@ -2418,9 +2418,15 @@ def export_realm_wrapper(
|
||||
|
||||
|
||||
def get_realm_exports_serialized(user: UserProfile) -> List[Dict[str, Any]]:
|
||||
# Exclude exports made via shell. 'acting_user=None', since they
|
||||
# aren't supported in the current API format.
|
||||
#
|
||||
# TODO: We should return those via the API as well, with an
|
||||
# appropriate way to express for who issued them; this requires an
|
||||
# API change.
|
||||
all_exports = RealmAuditLog.objects.filter(
|
||||
realm=user.realm, event_type=RealmAuditLog.REALM_EXPORTED
|
||||
)
|
||||
).exclude(acting_user=None)
|
||||
exports_dict = {}
|
||||
for export in all_exports:
|
||||
export_url = None
|
||||
|
||||
Reference in New Issue
Block a user