Fix exception being thrown on URLs with nonexistent review id

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

nh2
Djblets
master
2551
djblets
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.
Description From Last Updated

We like these alphabetically ordered- so this should be before django.core.urlresolvers.

mike_conleymike_conley
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/webapi/resources.py
      Ignored Files:
    
    
  2. 
      
NH
mike_conley
  1. 
      
  2. djblets/webapi/resources.py (Diff revision 1)
     
     
    We like these alphabetically ordered- so this should be before django.core.urlresolvers.
  3. 
      
NH
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/webapi/resources.py
      Ignored Files:
    
    
  2. 
      
NH
david
  1. Ship It!
  2. 
      
NH
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (0de0062). Thanks!
Loading...