You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/07/26 06:10:30 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #32838: Add `get_user` method in auth manager
uranusjr commented on code in PR #32838:
URL: https://github.com/apache/airflow/pull/32838#discussion_r1274419030
##########
airflow/api_connexion/endpoints/dag_run_endpoint.py:
##########
@@ -357,7 +357,7 @@ def post_dag_run(*, dag_id: str, session: Session = NEW_SESSION) -> APIResponse:
)
dag_run_note = post_body.get("note")
if dag_run_note:
- current_user_id = getattr(current_user, "id", None)
+ current_user_id = get_auth_manager().get_user().get_id()
Review Comment:
I wonder if the interface should be `get_auth_manager().get_user_id()` instead. In many situations the ID can be retrieved very cheaply without building a concrete user object.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org