Fix a crash when attempting to set submitter to an invalid value.

Review Request #10143 — Created Sept. 12, 2018 and submitted

Information

Review Board
release-3.0.x
76a0cb5...

Reviewers

We had some error handling for checking that someone wasn't trying to
set the submitter of a review request to a user that didn't exist, but
this failed in the local site case (and in the case of other failures
such as authentication backend errors). This change reorders the code so
that we don't get an UnboundLocalError, instead returning the correct
webapi error.

This adds a couple unit tests for the two cases (expected and unexpected
errors), and cleans up a related unit test that I came across while I
was in here.

Ran unit tests.

Description From Last Updated

E722 do not use bare except'

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

flake8

david
brennie
  1. 
      
  2. Any reason you're not using webapi_test_template for these tests?

    1. None of the others in this file use it. I can clean that up but it should be a separate change.

  3. 
      
brennie
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (7633758)