ahilashsasidharan commented on code in PR #63994:
URL: https://github.com/apache/airflow/pull/63994#discussion_r3069413018


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/variables.py:
##########
@@ -60,6 +61,12 @@ class VariableBody(StrictBaseModel):
     description: str | None = Field(default=None)
     team_name: str | None = Field(max_length=50, default=None)
 
+    @model_validator(mode="after")
+    def validate_team_name(self) -> VariableBody:
+        if self.team_name is not None and not conf.getboolean("core", 
"multi_team"):
+            raise ValueError("team_name cannot be set when multi_team mode is 
disabled")
+        return self

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]

Reply via email to