fixes restore experiment error [fixes SCI-464]

This commit is contained in:
zmagod 2016-09-21 08:34:32 +02:00
parent 57563b9a18
commit bf8e2a208f
2 changed files with 9 additions and 0 deletions

View file

@ -76,16 +76,24 @@ class ExperimentsController < ApplicationController
@experiment.touch(:workflowimg_updated_at)
flash[:success] = t('experiments.update.success_flash',
experiment: @experiment.name)
respond_to do |format|
format.json do
render json: {}, status: :ok
end
format.html do
redirect_to project_path(@experiment.project)
end
end
else
flash[:alert] = t('experiments.archive.restore_flash')
respond_to do |format|
format.json do
render json: @experiment.errors, status: :unprocessable_entity
end
format.html do
redirect_to :back
end
end
end
end

View file

@ -631,6 +631,7 @@ en:
success_flash: "Successfully archived experiment %{experiment}"
error_flash: 'Could not archive the experiment.'
label_title: 'Archive'
restore_flash: 'Something went wrong try to restore the experiment later'
clone:
modal_title: 'Clone experiment %{experiment}'
label_title: 'Clone'