MCPcopy Index your code
hub / github.com/hunvreus/devpush / create_environment

Method create_environment

app/models.py:432–447  ·  view source on GitHub ↗

Create a new environment with a unique ID

(self, name: str, slug: str, **kwargs)

Source from the content-addressed store, hash-verified

430 )
431
432 def create_environment(self, name: str, slug: str, **kwargs) -> dict:
433 """Create a new environment with a unique ID"""
434 if self.has_active_environment_with_slug(slug):
435 raise ValueError(f"An active environment with slug '{slug}' already exists")
436
437 env = {
438 "id": token_hex(4),
439 "name": name,
440 "slug": slug,
441 "status": "active",
442 **kwargs,
443 }
444 environments = self.environments.copy()
445 environments.append(env)
446 self.environments = environments
447 return env
448
449 def update_environment(self, environment_id: str, values: dict) -> dict | None:
450 """Update environment"""

Callers 1

project_settingsFunction · 0.80

Tested by

no test coverage detected