Skip to content

Commit

Permalink
Don't call get_id twice
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored and pateash committed Dec 23, 2023
1 parent 5ba859d commit b6f9154
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion airflow/auth/managers/base_auth_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit b6f9154

Please sign in to comment.