mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
websocket_client: Use get_system_bot.
This messy code is used only for our websocket Nagios tests, so using get_system_bot makes sense.
This commit is contained in:
@@ -16,7 +16,7 @@ from tornado.websocket import websocket_connect, WebSocketClientConnection
|
|||||||
from six.moves.urllib.parse import urlparse, urlunparse, urljoin
|
from six.moves.urllib.parse import urlparse, urlunparse, urljoin
|
||||||
from six.moves.http_cookies import SimpleCookie
|
from six.moves.http_cookies import SimpleCookie
|
||||||
|
|
||||||
from zerver.models import UserProfile
|
from zerver.models import get_system_bot
|
||||||
|
|
||||||
from typing import Any, Callable, Dict, Generator, Iterable, Optional
|
from typing import Any, Callable, Dict, Generator, Iterable, Optional
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ class WebsocketClient(object):
|
|||||||
# type: (str, str, str, Callable, bool, **Any) -> None
|
# type: (str, str, str, Callable, bool, **Any) -> None
|
||||||
self.validate_ssl = validate_ssl
|
self.validate_ssl = validate_ssl
|
||||||
self.auth_email = sender_email
|
self.auth_email = sender_email
|
||||||
self.user_profile = UserProfile.objects.filter(email=self.auth_email).first()
|
self.user_profile = get_system_bot(sender_email)
|
||||||
self.request_id_number = 0
|
self.request_id_number = 0
|
||||||
self.parsed_host_url = urlparse(host_url)
|
self.parsed_host_url = urlparse(host_url)
|
||||||
self.sockjs_url = sockjs_url
|
self.sockjs_url = sockjs_url
|
||||||
|
|||||||
Reference in New Issue
Block a user