mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
ruff: Fix UP007 Use X | Y for type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
e08a24e47f
commit
531b34cb4c
@@ -1,5 +1,5 @@
|
||||
# Webhooks for external integrations.
|
||||
from typing import Callable, Optional
|
||||
from typing import Callable
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
@@ -45,7 +45,7 @@ def ticket_started_body(payload: WildValue) -> str:
|
||||
)
|
||||
|
||||
|
||||
def ticket_assigned_body(payload: WildValue) -> Optional[str]:
|
||||
def ticket_assigned_body(payload: WildValue) -> str | None:
|
||||
state = payload["state"].tame(check_string)
|
||||
kwargs = {
|
||||
"state": "open" if state == "opened" else state,
|
||||
@@ -90,7 +90,7 @@ def replied_body(actor: str, action: str, payload: WildValue) -> str:
|
||||
return body
|
||||
|
||||
|
||||
EVENTS_FUNCTION_MAPPER: dict[str, Callable[[WildValue], Optional[str]]] = {
|
||||
EVENTS_FUNCTION_MAPPER: dict[str, Callable[[WildValue], str | None]] = {
|
||||
"ticket_started": ticket_started_body,
|
||||
"ticket_assigned": ticket_assigned_body,
|
||||
"agent_replied": partial(replied_body, "agent", "replied to"),
|
||||
|
||||
Reference in New Issue
Block a user