Check if an active environment with given slug exists
(
self, slug: str, exclude_id: str | None = None
)
| 419 | return env_vars |
| 420 | |
| 421 | def has_active_environment_with_slug( |
| 422 | self, slug: str, exclude_id: str | None = None |
| 423 | ) -> bool: |
| 424 | """Check if an active environment with given slug exists""" |
| 425 | return any( |
| 426 | environment |
| 427 | for environment in self.active_environments |
| 428 | if environment.get("slug") == slug |
| 429 | and (exclude_id is None or environment.get("id") != exclude_id) |
| 430 | ) |
| 431 | |
| 432 | def create_environment(self, name: str, slug: str, **kwargs) -> dict: |
| 433 | """Create a new environment with a unique ID""" |
no outgoing calls
no test coverage detected