settings: Rework how push notifications service is configured.

Instead of the PUSH_NOTIFICATIONS_BOUNCER_URL and
SUBMIT_USAGE_STATISTICS settings, we want servers to configure
individual ZULIP_SERVICE_* settings, while maintaining backward
compatibility with the old settings. Thus, if all the new
ZULIP_SERVICE_* are at their default False value, but the legacy
settings are activated, they need to be translated in computed_settings
to the modern way.
This commit is contained in:
Mateusz Mandera
2024-07-16 22:52:01 +02:00
committed by Tim Abbott
parent 722842a0aa
commit 4a93149435
22 changed files with 374 additions and 140 deletions

View File

@@ -1,6 +1,7 @@
from collections.abc import Callable
from dataclasses import dataclass, field
from datetime import datetime
from enum import IntEnum
from typing import Any, TypeAlias, TypeVar
from django_stubs_ext import StrPromise
@@ -326,3 +327,10 @@ class RawUserDict(TypedDict):
class RemoteRealmDictValue(TypedDict):
can_push: bool
expected_end_timestamp: int | None
class AnalyticsDataUploadLevel(IntEnum):
NONE = 0
BASIC = 1
BILLING = 2
ALL = 3