ahilashsasidharan commented on code in PR #63994:
URL: https://github.com/apache/airflow/pull/63994#discussion_r3040533683
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py:
##########
@@ -149,15 +149,24 @@ def get_connections(
"",
status_code=status.HTTP_201_CREATED,
responses=create_openapi_http_exception_doc(
- [status.HTTP_409_CONFLICT]
- ), # handled by global exception handler
+ [
+ status.HTTP_400_BAD_REQUEST,
+ status.HTTP_409_CONFLICT, # handled by global exception handler
+ ]
+ ),
dependencies=[Depends(requires_access_connection(method="POST")),
Depends(action_logging())],
)
def post_connection(
post_body: ConnectionBody,
session: SessionDep,
) -> ConnectionResponse:
"""Create connection entry."""
+ if post_body.team_name is not None and not conf.getboolean("core",
"multi_team"):
+ raise HTTPException(
+ status.HTTP_400_BAD_REQUEST,
+ "team_name cannot be set when multi_team mode is disabled. Please
contact your administrator.",
+ )
Review Comment:
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]