From c182a0c7a0b60e5cf4a42f320f832e0df6bcd8ab Mon Sep 17 00:00:00 2001 From: Rhea Parekh Date: Thu, 5 Jul 2018 21:48:40 +0530 Subject: [PATCH] export: export RealmAuditLog. --- zerver/lib/export.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zerver/lib/export.py b/zerver/lib/export.py index 8e1a46e8ee..1c79f62384 100644 --- a/zerver/lib/export.py +++ b/zerver/lib/export.py @@ -18,7 +18,8 @@ from zerver.models import UserProfile, Realm, Client, Huddle, Stream, \ UserMessage, Subscription, Message, RealmEmoji, RealmFilter, Reaction, \ RealmDomain, Recipient, DefaultStream, get_user_profile_by_id, \ UserPresence, UserActivity, UserActivityInterval, CustomProfileField, \ - CustomProfileFieldValue, get_display_recipient, Attachment, get_system_bot + CustomProfileFieldValue, get_display_recipient, Attachment, get_system_bot, \ + RealmAuditLog from zerver.lib.parallel import run_parallel from typing import Any, Callable, Dict, List, Optional, Set, Tuple, \ Iterable, Union @@ -167,7 +168,6 @@ NON_EXPORTED_TABLES = { 'zerver_botstoragedata', 'zerver_botconfigdata', 'zerver_mutedtopic', - 'zerver_realmauditlog', 'zerver_pushdevicetoken', 'zerver_service', 'zerver_usergroup', @@ -201,6 +201,7 @@ DATE_FIELDS = { 'zerver_useractivityinterval': ['start', 'end'], 'zerver_userpresence': ['timestamp'], 'zerver_userprofile': ['date_joined', 'last_login', 'last_reminder'], + 'zerver_realmauditlog': ['event_time'], } # type: Dict[TableName, List[Field]] def sanity_check_output(data: TableData) -> None: @@ -578,6 +579,13 @@ def get_realm_config() -> Config: parent_key='user_profile__in', ) + Config( + table='zerver_realmauditlog', + model=RealmAuditLog, + normal_parent=user_profile_config, + parent_key='modified_user__in', + ) + # Some of these tables are intermediate "tables" that we # create only for the export. Think of them as similar to views.