| 235 | |
| 236 | |
| 237 | class ProjectEnvironmentRemoveForm(StarletteForm): |
| 238 | environment_id = HiddenField(validators=[DataRequired()]) |
| 239 | confirm = StringField(_l("Confirmation"), validators=[DataRequired()]) |
| 240 | submit = SubmitField(_l("Delete")) |
| 241 | |
| 242 | def __init__(self, *args, project, **kwargs): |
| 243 | super().__init__(*args, **kwargs) |
| 244 | self.project = project |
| 245 | |
| 246 | def validate_confirm(self, field): |
| 247 | environment = self.project.get_environment_by_id(self.environment_id.data) # type: ignore |
| 248 | if not environment: |
| 249 | raise ValidationError(_("Environment not found.")) |
| 250 | if field.data != environment["slug"]: |
| 251 | raise ValidationError( |
| 252 | _("Environment identifier confirmation did not match.") |
| 253 | ) |
| 254 | |
| 255 | |
| 256 | class ProjectResourcesForm(StarletteForm): |
nothing calls this directly
no outgoing calls
no test coverage detected