Allow unsetting repos, groups, and users in default reviewers API
Review Request #8952 — Created May 19, 2017 and submitted — Latest diff uploaded
Previously, if a request against the default reviewers API tried to
unset one of therepositories
,users
, orgroups
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.