Skip to content

Commit 0d6615a

Browse files
refactor: easier to read boolean expression
Co-authored-by: Ivan Kanakarakis <[email protected]>
1 parent 45c4aa1 commit 0d6615a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/satosa/backends/apple.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ def response_endpoint(self, context, *args):
113113

114114
# convert "string or Boolean" claims to actual booleans
115115
for bool_claim_name in ["email_verified", "is_private_email"]:
116-
if type(userinfo.get(bool_claim_name)) == str:
117-
userinfo[bool_claim_name] = userinfo[bool_claim_name] == "true"
116+
userinfo[bool_claim_name] = (
117+
True
118+
if userinfo[bool_claim_name] == "true"
119+
else False
120+
)
118121

119122
msg = "UserInfo: {}".format(all_user_claims)
120123
logline = lu.LOG_FMT.format(id=lu.get_session_id(context.state), message=msg)

0 commit comments

Comments
 (0)