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

Method validate_name

app/forms/project.py:211–217  ·  view source on GitHub ↗
(self, field)

Source from the content-addressed store, hash-verified

209 self.project = project
210
211 def validate_name(self, field):
212 if self.environment_id.data: # type: ignore
213 env = self.project.get_environment_by_id(self.environment_id.data) # type: ignore
214 if env["slug"] == "production" and field.data != env["name"]:
215 raise ValidationError(
216 _("The production environment name cannot be modified.")
217 )
218
219 def validate_slug(self, field):
220 if self.environment_id.data: # type: ignore

Callers

nothing calls this directly

Calls 2

get_environment_by_idMethod · 0.80
_Function · 0.50

Tested by

no test coverage detected