Allow unsetting repos, groups, and users in default reviewers API

Review Request #8952 — Created May 19, 2017 and submitted

Information

Review Board
release-2.5.x
d3cd20f...

Reviewers

Previously, if a request against the default reviewers API tried to
unset one of the repositories, users, or groups fields, it would
result in an error. This was due to the API code not handling the case
of an empty string being submitted (which would get split into the list
['']) and result in us not being able to lookup the appropriate model
instances. We now filter out empty results from the list to ensure we
query the database with valid repository, user, and group names.

This change also cleans up the compare_item method for default
reviewers tests so that it compares against the provided values instead
of hardcoded ones.

Ran unit tests.

Description From Last Updated

W391 blank line at end of file

reviewbotreviewbot

W391 blank line at end of file

reviewbotreviewbot

E303 too many blank lines (2)

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

brennie
Review request changed

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

brennie
brennie
Review request changed

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

brennie
chipx86
  1. 
      
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (50e0fa4)
Loading...