Project

Profile

Help

Issue #2974

closed

Error when attempting to create two repos with the same name

Added by daviddavis over 7 years ago. Updated over 5 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
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

Is duplicate of Pulp - Story #2984: As an API user, I get user friendly feedback when I use an invalid valueCLOSED - CURRENTRELEASEbizhang

Actions
Actions #1

Updated by daviddavis over 7 years ago

  • Tags Easy Fix, Pulp 3 added
Actions #2

Updated by ttereshc over 7 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by daviddavis over 7 years ago

  • Status changed from NEW to CLOSED - DUPLICATE
Actions #4

Updated by daviddavis over 7 years ago

  • Is duplicate of Story #2984: As an API user, I get user friendly feedback when I use an invalid value added
Actions #5

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #6

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)

Also available in: Atom PDF