From d6d7072da52c5d84fd39a33500ce5901c2fe900b Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 8 Dec 2025 12:48:49 +0800 Subject: [PATCH] perf: request.GET.copy() to dict(), because copy() returned values is list [] --- apps/authentication/backends/oauth2/views.py | 2 +- apps/authentication/backends/oidc/views.py | 2 +- apps/authentication/backends/saml2/views.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/authentication/backends/oauth2/views.py b/apps/authentication/backends/oauth2/views.py index f120b6a6e..b7f1c48f8 100644 --- a/apps/authentication/backends/oauth2/views.py +++ b/apps/authentication/backends/oauth2/views.py @@ -22,7 +22,7 @@ class OAuth2AuthRequestView(View): log_prompt = "Process OAuth2 GET requests: {}" logger.debug(log_prompt.format('Start')) - request_params = request.GET.copy() + request_params = request.GET.dict() request_params.pop('next', None) query = urlencode(request_params) redirect_uri = build_absolute_uri( diff --git a/apps/authentication/backends/oidc/views.py b/apps/authentication/backends/oidc/views.py index adcf886aa..13aa5d30c 100644 --- a/apps/authentication/backends/oidc/views.py +++ b/apps/authentication/backends/oidc/views.py @@ -67,7 +67,7 @@ class OIDCAuthRequestView(View): # Defines common parameters used to bootstrap the authentication request. logger.debug(log_prompt.format('Construct request params')) - request_params = request.GET.copy() + request_params = request.GET.dict() request_params.pop('next', None) request_params.update({ 'scope': settings.AUTH_OPENID_SCOPES, diff --git a/apps/authentication/backends/saml2/views.py b/apps/authentication/backends/saml2/views.py index c675b4efc..55c0a0b52 100644 --- a/apps/authentication/backends/saml2/views.py +++ b/apps/authentication/backends/saml2/views.py @@ -207,7 +207,7 @@ class Saml2AuthRequestView(View, PrepareRequestMixin): log_prompt = "Process SAML GET requests: {}" logger.debug(log_prompt.format('Start')) - request_params = request.GET.copy() + request_params = request.GET.dict() try: saml_instance = self.init_saml_auth(request)