diff options
Diffstat (limited to 'app/controllers/groups/labels_controller.rb')
-rw-r--r-- | app/controllers/groups/labels_controller.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/groups/labels_controller.rb b/app/controllers/groups/labels_controller.rb index 2d821676677..57bca5ebc52 100644 --- a/app/controllers/groups/labels_controller.rb +++ b/app/controllers/groups/labels_controller.rb @@ -64,8 +64,13 @@ class Groups::LabelsController < Groups::ApplicationController end def destroy - @label.destroy - redirect_to group_labels_path(@group), status: :found, notice: "#{@label.name} deleted permanently" + if @label.destroy + redirect_to group_labels_path(@group), status: :found, + notice: format(_('%{label_name} was removed'), label_name: @label.name) + else + redirect_to group_labels_path(@group), status: :found, + alert: @label.errors.full_messages.to_sentence + end end protected |