(self, field)
| 217 | ) |
| 218 | |
| 219 | def validate_slug(self, field): |
| 220 | if self.environment_id.data: # type: ignore |
| 221 | env = self.project.get_environment_by_id(self.environment_id.data) # type: ignore |
| 222 | if field.data == env["slug"]: |
| 223 | return |
| 224 | |
| 225 | if env["slug"] == "production": |
| 226 | raise ValidationError( |
| 227 | _("The production environment identifier cannot be modified.") |
| 228 | ) |
| 229 | |
| 230 | # New environment |
| 231 | if self.project.has_active_environment_with_slug(field.data): |
| 232 | raise ValidationError( |
| 233 | _("This identifier is already in use by another environment.") |
| 234 | ) |
| 235 | |
| 236 | |
| 237 | class ProjectEnvironmentRemoveForm(StarletteForm): |
nothing calls this directly
no test coverage detected