(self, instance: Experiment)
| 319 | ) |
| 320 | |
| 321 | def perform_destroy(self, instance: Experiment) -> None: |
| 322 | if instance.status == ExperimentStatus.RUNNING: |
| 323 | raise serializers.ValidationError( |
| 324 | { |
| 325 | "detail": ( |
| 326 | "Cannot delete a running experiment. " |
| 327 | "Pause or complete it first." |
| 328 | ) |
| 329 | } |
| 330 | ) |
| 331 | create_experiment_audit_log( |
| 332 | instance, self._get_user(self.request), action="deleted" |
| 333 | ) |
| 334 | instance.delete() |
| 335 | |
| 336 | @action(detail=True, methods=["post"]) |
| 337 | def start(self, request: Request, **kwargs: object) -> Response: |
nothing calls this directly
no test coverage detected