summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/auth_sources_controller.rb2
-rw-r--r--config/locales/en.yml1
-rw-r--r--test/functional/auth_sources_controller_test.rb1
3 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/auth_sources_controller.rb b/app/controllers/auth_sources_controller.rb
index dcbba3687..ed0b415e5 100644
--- a/app/controllers/auth_sources_controller.rb
+++ b/app/controllers/auth_sources_controller.rb
@@ -68,6 +68,8 @@ class AuthSourcesController < ApplicationController
unless @auth_source.users.exists?
@auth_source.destroy
flash[:notice] = l(:notice_successful_delete)
+ else
+ flash[:error] = l(:error_can_not_delete_auth_source)
end
redirect_to auth_sources_path
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 018235a3d..38808a23a 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -221,6 +221,7 @@ en:
error_cannot_reassign_time_entries_to_an_issue_about_to_be_deleted: "Spent time cannot be reassigned to an issue that is about to be deleted"
warning_fields_cleared_on_bulk_edit: "Changes will result in the automatic deletion of values from one or more fields on the selected objects"
error_exceeds_maximum_hours_per_day: "Cannot log more than %{max_hours} hours on the same day (%{logged_hours} hours have already been logged)"
+ error_can_not_delete_auth_source: "This authentication mode is in use and cannot be deleted."
mail_subject_lost_password: "Your %{value} password"
mail_body_lost_password: 'To change your password, click on the following link:'
diff --git a/test/functional/auth_sources_controller_test.rb b/test/functional/auth_sources_controller_test.rb
index e6bfcf54c..adc6c1a22 100644
--- a/test/functional/auth_sources_controller_test.rb
+++ b/test/functional/auth_sources_controller_test.rb
@@ -159,6 +159,7 @@ class AuthSourcesControllerTest < Redmine::ControllerTest
:id => 1
}
assert_redirected_to '/auth_sources'
+ assert_equal 'This authentication mode is in use and cannot be deleted.', flash[:error]
end
end