[#135] set rejector in api & small controllers refactoring
This commit is contained in:
parent
afd24a65f5
commit
b9a8464307
|
@ -34,11 +34,11 @@ class Api::V1::BuildListsController < Api::V1::BaseController
|
|||
|
||||
def publish
|
||||
@build_list.publisher = current_user
|
||||
@build_list.save
|
||||
render_json :publish
|
||||
end
|
||||
|
||||
def reject_publish
|
||||
@build_list.publisher = current_user
|
||||
render_json :reject_publish
|
||||
end
|
||||
|
||||
|
|
|
@ -171,11 +171,10 @@ class Projects::BuildListsController < Projects::BaseController
|
|||
redirect_to :back, :notice => t('layout.build_lists.publish_fail') and return
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@build_list.publisher = current_user
|
||||
if @build_list.save && @build_list.can_publish? && @build_list.now_publish
|
||||
if @build_list.publish
|
||||
redirect_to :back, :notice => t('layout.build_lists.publish_success')
|
||||
else
|
||||
redirect_to :back, :notice => t('layout.build_lists.publish_fail')
|
||||
|
|
Loading…
Reference in New Issue