From 949bdce5c124ed0acf47d9bfa42d046e00dcc341 Mon Sep 17 00:00:00 2001 From: lian Date: Wed, 9 Sep 2020 10:36:27 +0800 Subject: [PATCH] encode("iso-8859-1") for shibboleth login (#4667) Co-authored-by: lian --- thirdpart/shibboleth/middleware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thirdpart/shibboleth/middleware.py b/thirdpart/shibboleth/middleware.py index 63fe398a6a..730112248c 100755 --- a/thirdpart/shibboleth/middleware.py +++ b/thirdpart/shibboleth/middleware.py @@ -156,10 +156,11 @@ class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware): p = Profile(user=user.username) if nickname.strip(): # set nickname when it's not empty - p.nickname = nickname + p.nickname = nickname.encode("iso-8859-1").decode('utf8') if institution: p.institution = institution + if contact_email: p.contact_email = contact_email