-
Notifications
You must be signed in to change notification settings - Fork 461
Open
Open
Copy link
Labels
Geti Tune BackendIssues related to Geti Tune Studio backendIssues related to Geti Tune Studio backend
Description
Steps to reproduce
- Try to create a Geti Tune project with two labels that have the same name
This is equivalent to submitting this request (note the duplicate labels):
curl -s -x POST localhost:7860/api/projects -H "Content-Type: application/json" --data '{ "name": "animals", "task": { "task_type": "classification", "exclusive_labels": true, "labels": [ { "name": "cat" }, { "name": "cat" } ] } }'
Expected behavior
The request is rejected with error 404 or 409, with a message that indicates the duplicate label
Actual behavior
The request is rejected with a misleading message:
{"detail":"Project with name 'animals' already exists."}
The project name is not duplicated, the label names are (within the request). This issue is probably caused by how integrity errors raised by children entities are handled and propagated to the parent:
raise ResourceAlreadyExistsError(self.config.resource_type, getattr(item, "name", str(item.id))) # type: ignore[attr-defined] |
Metadata
Metadata
Assignees
Labels
Geti Tune BackendIssues related to Geti Tune Studio backendIssues related to Geti Tune Studio backend