Fix exception being thrown on URLs with nonexistent review id

Review Request #3767 — Created Jan. 18, 2013 and submitted — Latest diff uploaded

Information

Djblets
master

Reviewers

Fix exception being thrown on URLs with nonexistent review id

URLs like /api/review-requests/<id>/screenshots, where <id> is nonexistent, until now threw an exception instead of translating to a proper 404.

This change catches the possible ObjectDoesNotExist of get_queryset() in WebAPIResource.get_list.

Fixes #2551.
webapi.tests.ScreenshotResourceTests.test_get_screenshots_with_invalid_review_request_id in the corresponding change for revieboard tests this behavior.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2
djblets/webapi/resources.py
Loading...