mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
mypy: Use Python 3 type syntax in zerver/webhooks/newrelic/view.py.
This commit is contained in:
@@ -13,10 +13,11 @@ from zerver.models import Stream, UserProfile
|
|||||||
|
|
||||||
@api_key_only_webhook_view("NewRelic")
|
@api_key_only_webhook_view("NewRelic")
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def api_newrelic_webhook(request, user_profile, stream=REQ(default='newrelic'),
|
def api_newrelic_webhook(request: HttpRequest, user_profile: UserProfile,
|
||||||
alert=REQ(validator=check_dict([]), default=None),
|
stream: Text=REQ(default='newrelic'),
|
||||||
deployment=REQ(validator=check_dict([]), default=None)):
|
alert: Optional[Dict[str, Any]]=REQ(validator=check_dict([]), default=None),
|
||||||
# type: (HttpRequest, UserProfile, Text, Optional[Dict[str, Any]], Optional[Dict[str, Any]]) -> HttpResponse
|
deployment: Optional[Dict[str, Any]]=REQ(validator=check_dict([]), default=None)
|
||||||
|
)-> HttpResponse:
|
||||||
if alert:
|
if alert:
|
||||||
# Use the message as the subject because it stays the same for
|
# Use the message as the subject because it stays the same for
|
||||||
# "opened", "acknowledged", and "closed" messages that should be
|
# "opened", "acknowledged", and "closed" messages that should be
|
||||||
|
|||||||
Reference in New Issue
Block a user