Skip to content

Commit 491a2cb

Browse files
authored
Merge pull request #930 from RS-PYTHON/fix/fix-keycloak-mypy-error
Fix mypy error occuring when updating python dependencies
2 parents b191b5c + 1edefdf commit 491a2cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/common/rs_server_common/authentication/keycloak_util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ def get_user_info(self, user_id: str) -> KCInfo:
8787

8888
# If the user is not found, this means he was removed from keycloak.
8989
# Thus we must remove all his api keys from the database.
90-
if (error.response_code == HTTP_404_NOT_FOUND) and (
91-
"User not found" in error.response_body.decode("utf-8")
90+
if (
91+
error.response_code == HTTP_404_NOT_FOUND
92+
and error.response_body is not None
93+
and "User not found" in error.response_body.decode("utf-8")
9294
):
9395
logger.warning(f"User '{user_id}' not found in keycloak.")
9496
return KCInfo(False, [])

0 commit comments

Comments
 (0)