mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
models: Add push_notifications_enabled & corresponding end_timestamp.
Add two fields to Realm model: *push_notifications_enabled *push_notifications_enabled_end_timestamp Co-authored-by: Prakhar Pratyush <prakhar@zulip.com>
This commit is contained in:
@@ -27,6 +27,7 @@ from zerver.lib.export import DATE_FIELDS, Field, Path, Record, TableData, Table
|
||||
from zerver.lib.markdown import markdown_convert
|
||||
from zerver.lib.markdown import version as markdown_version
|
||||
from zerver.lib.message import get_last_message_id
|
||||
from zerver.lib.push_notifications import sends_notifications_directly
|
||||
from zerver.lib.remote_server import enqueue_register_realm_with_push_bouncer_if_needed
|
||||
from zerver.lib.server_initialization import create_internal_realm, server_initialized
|
||||
from zerver.lib.streams import render_stream_description
|
||||
@@ -974,6 +975,9 @@ def do_import_realm(import_dir: Path, subdomain: str, processes: int = 1) -> Rea
|
||||
realm_properties = dict(**data["zerver_realm"][0])
|
||||
realm_properties["deactivated"] = True
|
||||
|
||||
# Initialize whether we expect push notifications to work.
|
||||
realm_properties["push_notifications_enabled"] = sends_notifications_directly()
|
||||
|
||||
with transaction.atomic(durable=True):
|
||||
realm = Realm(**realm_properties)
|
||||
if "zerver_usergroup" not in data:
|
||||
|
||||
Reference in New Issue
Block a user