Actions
Issue #2974
closedError when attempting to create two repos with the same name
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix
Sprint:
Quarter:
Description
Steps to reproduce:
$ http POST :8000/api/v3/repositories/ name=test importers:='[]' publishers:='[]' scratchpad:='{"test": "asgfdds"}'
$ http POST :8000/api/v3/repositories/ name=test importers:='[]' publishers:='[]' scratchpad:='{"test": "asgfdds"}'
You get a 500 error:
HTTP/1.0 500 Internal Server Error
Content-Length: 22277
Content-Type: text/plain
Date: Mon, 14 Aug 2017 20:59:15 GMT
Server: WSGIServer/0.2 CPython/3.5.3
Vary: Cookie
X-Frame-Options: SAMEORIGIN
IntegrityError at /api/v3/repositories/
duplicate key value violates unique constraint "pulp_app_repository_name_key"
DETAIL: Key (name)=(test) already exists.
...
Looks like we need to add a UniqueValidator to the name field in the repo serializer.
Related issues
Actions