Provide a good error when trying to POST a duplicate repository.

Review Request #6795 — Created Jan. 17, 2015 and submitted

Information

Review Board
release-2.0.x
8df907d...

Reviewers

Our validation when using the repository resource to create new repositories
handled the case where an individual field in the model didn't validate, but
didn't handle the case of conflicting names.

This adds a new API error for when the repository already exists, and adds a
test to verify that it's being used.

Ran unit tests.

Description From Last Updated

This needs to go in the list of errors in the decorator. Since we're changing the expected error condition, the …

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/repository.py
        reviewboard/webapi/errors.py
        reviewboard/webapi/tests/test_repository.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/repository.py
        reviewboard/webapi/errors.py
        reviewboard/webapi/tests/test_repository.py
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    This needs to go in the list of errors in the decorator.

    Since we're changing the expected error condition, the docstring should also be updated to say that starting in 2.0.13, it returns this, and previously it returned the other thing.

    1. I don't think we need to change the docstring because previously it returned a 500 error with a traceback.

    2. Ah, yes, this is an improvement then :)

  3. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/repository.py
        reviewboard/webapi/errors.py
        reviewboard/webapi/tests/test_repository.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/repository.py
        reviewboard/webapi/errors.py
        reviewboard/webapi/tests/test_repository.py
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (47cd8fa)
Loading...