Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/labels_controller.rb')
-rw-r--r--app/controllers/projects/labels_controller.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb
index 649bead0b6d..67cff16a76b 100644
--- a/app/controllers/projects/labels_controller.rb
+++ b/app/controllers/projects/labels_controller.rb
@@ -79,10 +79,13 @@ class Projects::LabelsController < Projects::ApplicationController
end
def destroy
- @label.destroy
- @labels = find_labels
-
- redirect_to project_labels_path(@project), status: :found, notice: 'Label was removed'
+ if @label.destroy
+ redirect_to project_labels_path(@project), status: :found,
+ notice: format(_('%{label_name} was removed'), label_name: @label.name)
+ else
+ redirect_to project_labels_path(@project), status: :found,
+ alert: @label.errors.full_messages.to_sentence
+ end
end
def remove_priority