diff --git a/airflow/auth/managers/base_auth_manager.py b/airflow/auth/managers/base_auth_manager.py index 80932523cbfb5e..25a3b514d47ca7 100644 --- a/airflow/auth/managers/base_auth_manager.py +++ b/airflow/auth/managers/base_auth_manager.py @@ -105,7 +105,9 @@ def get_user_id(self) -> str | None: if not user: self.log.error("Calling 'get_user_id()' but the user is not signed in.") raise AirflowException("The user must be signed in.") - return str(user.get_id()) if user.get_id() else None + if user_id := user.get_id(): + return str(user_id) + return None def init(self) -> None: """