Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix PYI061 Use `None` rather than `Literal[None]`.

Anders Kaseorge9abaacd5c27
diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.py
index de21e071595..7ae475ce6f6 100644
--- a/corporate/views/billing_page.py
+++ b/corporate/views/billing_page.py
@@ -326,7 +326,7 @@ def remote_server_deactivate_page(
request: HttpRequest,
billing_session: "RemoteServerBillingSession",
*,
- confirmed: Literal[None, "true"] = None,
+ confirmed: Literal["true"] | None = None,
) -> HttpResponse:
from corporate.lib.stripe import (
ServerDeactivateWithExistingPlanError,
diff --git a/corporate/views/remote_billing_page.py b/corporate/views/remote_billing_page.py
index 9fb407d3375..9eee2817091 100644
--- a/corporate/views/remote_billing_page.py
+++ b/corporate/views/remote_billing_page.py
@@ -63,9 +63,9 @@ billing_logger = logging.getLogger("corporate.stripe")
VALID_NEXT_PAGES = [None, "sponsorship", "upgrade", "billing", "plans", "deactivate"]
-VALID_NEXT_PAGES_TYPE: TypeAlias = Literal[
- None, "sponsorship", "upgrade", "billing", "plans", "deactivate"
-]
+VALID_NEXT_PAGES_TYPE: TypeAlias = (
+ Literal["sponsorship", "upgrade", "billing", "plans", "deactivate"] | None
+)
REMOTE_BILLING_SIGNED_ACCESS_TOKEN_VALIDITY_IN_SECONDS = 2 * 60 * 60
# We use units of hours here so that we can pass this through to the
@@ -152,9 +152,9 @@ def remote_realm_billing_finalize_login(
*,
signed_billing_access_token: PathOnly[str],
full_name: str | None = None,
- tos_consent: Literal[None, "true"] = None,
- enable_major_release_emails: Literal[None, "true", "false"] = None,
- enable_maintenance_release_emails: Literal[None, "true", "false"] = None,
+ tos_consent: Literal["true"] | None = None,
+ enable_major_release_emails: Literal["true", "false"] | None = None,
+ enable_maintenance_release_emails: Literal["true", "false"] | None = None,
) -> HttpResponse:
"""
This is the endpoint accessed via the billing_access_url, generated by
@@ -673,9 +673,9 @@ def remote_billing_legacy_server_from_login_confirmation_link(
*,
confirmation_key: PathOnly[str],
full_name: str | None = None,
- tos_consent: Literal[None, "true"] = None,
- enable_major_release_emails: Literal[None, "true", "false"] = None,
- enable_maintenance_release_emails: Literal[None, "true", "false"] = None,
+ tos_consent: Literal["true"] | None = None,
+ enable_major_release_emails: Literal["true", "false"] | None = None,
+ enable_maintenance_release_emails: Literal["true", "false"] | None = None,
) -> HttpResponse:
"""
The user comes here via the confirmation link they received via email.
diff --git a/zerver/lib/event_types.py b/zerver/lib/event_types.py
index e24eff92d2e..ab90d87102a 100644
--- a/zerver/lib/event_types.py
+++ b/zerver/lib/event_types.py
@@ -903,7 +903,7 @@ class EventStreamUpdateCore(BaseEvent):
type: Literal["stream"]
op: Literal["update"]
property: str
- value: bool | int | str | UserGroupMembersDict | Literal[None]
+ value: bool | int | str | UserGroupMembersDict | None
name: str
stream_id: int