mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 04:43:58 +00:00
request: Use Django 5.2 HttpRequest.get_preferred_type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
6006ba4c44
commit
d24eab02d2
@@ -16,7 +16,6 @@ from corporate.lib.remote_billing_util import (
|
||||
get_remote_server_and_user_from_session,
|
||||
)
|
||||
from zerver.lib.exceptions import RemoteBillingAuthenticationError
|
||||
from zerver.lib.request import get_preferred_type
|
||||
from zerver.lib.subdomains import get_subdomain
|
||||
from zerver.lib.url_encoding import append_url_query_string
|
||||
from zilencer.models import RemoteRealm
|
||||
@@ -125,7 +124,7 @@ def authenticated_remote_realm_management_endpoint(
|
||||
|
||||
# Return error for AJAX requests with url.
|
||||
if (
|
||||
get_preferred_type(request, ["application/json", "text/html"]) != "text/html"
|
||||
request.get_preferred_type(["application/json", "text/html"]) != "text/html"
|
||||
): # nocoverage
|
||||
return session_expired_ajax_response(url)
|
||||
|
||||
@@ -211,7 +210,7 @@ def authenticated_remote_server_management_endpoint(
|
||||
|
||||
# Return error for AJAX requests with url.
|
||||
if (
|
||||
get_preferred_type(request, ["application/json", "text/html"]) != "text/html"
|
||||
request.get_preferred_type(["application/json", "text/html"]) != "text/html"
|
||||
): # nocoverage
|
||||
return session_expired_ajax_response(url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user