Issue 647: Error return value of _prepare_draft unused in webapi/

New issue report by chipx86:
The return value of _prepare_draft is assumed to be a ReviewRequestDraft,
when it could be an error. This can lead to problems if some other user
attempts to call such an API function. A draft won't be manipulated, but an
HTTP 500 will be generated, since we'll attempt to call functions on an  

_prepare_draft doesn't even seem to be smart about returning an existing
draft for a review request, which confuses me, but really this logic should
either go into the create method in a Manager for the draft or we should
provide a create_draft() function on ReviewRequest. In either case, an
exception should be raised if the user doesn't have the right permissions.
We should then catch it and return the proper webapi error.

Issue attributes:
        Status: Accepted
        Owner: chipx86
        Labels: Type-Defect Priority-High Component-API Milestone-Release1.0

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to