BURs: allow only pending BURs to be rejected.

Fix it being possible to reject approved BURs, or to re-reject already
rejected BURs.

Rejecting an approved BUR wouldn't revert the aliases/implications, but
it would change the BUR's status to rejected.
This commit is contained in:
evazion
2019-01-15 21:07:48 -06:00
parent 971281949f
commit a284d3fb4a
2 changed files with 10 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ class BulkUpdateRequestsController < ApplicationController
def show
@bulk_update_request = BulkUpdateRequest.find(params[:id])
respond_with(@bulk_update_request)
end
def edit
@@ -37,7 +38,7 @@ class BulkUpdateRequestsController < ApplicationController
end
def destroy
if @bulk_update_request.editable?(CurrentUser.user)
if @bulk_update_request.rejectable?(CurrentUser.user)
@bulk_update_request.reject!(CurrentUser.user)
flash[:notice] = "Bulk update request rejected"
respond_with(@bulk_update_request, :location => bulk_update_requests_path)