(self, attrs: dict[str, Any])
| 385 | return name |
| 386 | |
| 387 | def validate(self, attrs: dict[str, Any]) -> dict[str, Any]: |
| 388 | view = self.context["view"] |
| 389 | project_id = str(view.kwargs.get("project_pk")) |
| 390 | if not project_id.isdigit(): |
| 391 | raise serializers.ValidationError("Invalid project ID.") |
| 392 | |
| 393 | # If tags selected check they from the same Project as Feature Project |
| 394 | if any(tag.project_id != int(project_id) for tag in attrs.get("tags", [])): |
| 395 | raise serializers.ValidationError( |
| 396 | "Selected Tags must be from the same Project as current Feature" |
| 397 | ) |
| 398 | |
| 399 | self._validate_enforce_feature_owners(attrs) |
| 400 | |
| 401 | return attrs |
| 402 | |
| 403 | def _validate_enforce_feature_owners(self, attrs: dict[str, Any]) -> None: |
| 404 | project: Project = self.context["project"] |
no test coverage detected