# POST
def execute
bad_request('Missing review id') unless params[:id]
- review = Review.find(params[:id], :include => ['project'])
+ @review = Review.find(params[:id], :include => ['project'])
- access_denied unless has_rights_to_modify?(review.resource)
+ access_denied unless has_rights_to_modify?(@review.resource)
bad_request('Missing command') if params[:command].blank?
- RuleFailure.execute_command(params[:command], review.violation, review.resource.project, current_user, params)
+ RuleFailure.execute_command(params[:command], @review.violation, @review.resource.project, current_user, params)
- review.reload
- render :partial => "project_reviews/review", :locals => {:review => review}
+ @review.reload
+ render :partial => "project_reviews/view"
end
STATUS_RESOLVED = 'RESOLVED'
STATUS_REOPENED = 'REOPENED'
STATUS_CLOSED = 'CLOSED'
+ # "IDLE" is a non-persisted status of an non-existing review = when a violation does have a review yet
+ # It is currently used by rule_failure.rb (#to_java_workflow_review) to pass a list of reviews to the
+ # review workflow, even for violations which don't have yet a review.
+ STATUS_IDLE = 'IDLE'
RESOLUTION_FALSE_POSITIVE = 'FALSE-POSITIVE'
RESOLUTION_FIXED = 'FIXED'