From ff3d7b8bb7523fc62d5e12f0a74f7329436d21dd Mon Sep 17 00:00:00 2001 From: lian Date: Thu, 22 Aug 2024 14:46:29 +0800 Subject: [PATCH] fix encode error for shib institution attr (#6613) --- thirdpart/shibboleth/middleware.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/thirdpart/shibboleth/middleware.py b/thirdpart/shibboleth/middleware.py index ea1e2a7d49..4ba691050f 100755 --- a/thirdpart/shibboleth/middleware.py +++ b/thirdpart/shibboleth/middleware.py @@ -16,8 +16,6 @@ from shibboleth.app_settings import SHIB_ATTRIBUTE_MAP, LOGOUT_SESSION_KEY, \ from seahub import auth from seahub.base.accounts import User -from seahub.auth.models import SocialAuthUser -from seahub.base.sudo_mode import update_sudo_mode_ts from seahub.profile.models import Profile from seahub.utils.file_size import get_quota_from_string from seahub.role_permissions.utils import get_enabled_role_permissions_by_role @@ -179,7 +177,7 @@ class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware): p.nickname = nickname.encode("iso-8859-1").decode('utf8') if institution: - p.institution = institution + p.institution = institution.encode("iso-8859-1").decode('utf8') if contact_email: p.contact_email = contact_email