mirror of https://github.com/zulip/zulip.git
exports: Use realm for RealmAuditLog in realm exports.
For realm-wide exports, there is no reason to query inefficiently against a list of modified users. We move the Config out of the common child configs.
This commit is contained in:
parent
8dd3c1038f
commit
a2c4931316
|
@ -655,6 +655,13 @@ def get_realm_config() -> Config:
|
|||
include_rows="realm_id__in",
|
||||
)
|
||||
|
||||
Config(
|
||||
table="zerver_realmauditlog",
|
||||
model=RealmAuditLog,
|
||||
normal_parent=realm_config,
|
||||
include_rows="realm_id__in",
|
||||
)
|
||||
|
||||
Config(
|
||||
table="zerver_realmemoji",
|
||||
model=RealmEmoji,
|
||||
|
@ -875,13 +882,6 @@ def add_user_profile_child_configs(user_profile_config: Config) -> None:
|
|||
include_rows="user_profile_id__in",
|
||||
)
|
||||
|
||||
Config(
|
||||
table="zerver_realmauditlog",
|
||||
model=RealmAuditLog,
|
||||
normal_parent=user_profile_config,
|
||||
include_rows="modified_user_id__in",
|
||||
)
|
||||
|
||||
Config(
|
||||
table="zerver_useractivity",
|
||||
model=UserActivity,
|
||||
|
@ -1956,6 +1956,13 @@ def get_single_user_config() -> Config:
|
|||
include_rows="user_id__in",
|
||||
)
|
||||
|
||||
Config(
|
||||
table="zerver_realmauditlog",
|
||||
model=RealmAuditLog,
|
||||
normal_parent=user_profile_config,
|
||||
include_rows="modified_user_id__in",
|
||||
)
|
||||
|
||||
add_user_profile_child_configs(user_profile_config)
|
||||
|
||||
return user_profile_config
|
||||
|
|
Loading…
Reference in New Issue