about summary refs log tree commit diff
path: root/app/controllers/settings
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-12-14 21:35:30 +0100
committerGitHub <noreply@github.com>2017-12-14 21:35:30 +0100
commita3b2ea599df58b1d9944acba8b59f9a465f5adbd (patch)
tree7312c54e6723dda246501160738e88d6e82c6b4d /app/controllers/settings
parent573414f728b5406e2f402f3c21e8ffa38ffc6d8e (diff)
Fix #6022 - Prevent nested migrated accounts, or migrations to self (#6026)
Diffstat (limited to 'app/controllers/settings')
-rw-r--r--app/controllers/settings/migrations_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/settings/migrations_controller.rb b/app/controllers/settings/migrations_controller.rb
index b18403a7f..bc6436b87 100644
--- a/app/controllers/settings/migrations_controller.rb
+++ b/app/controllers/settings/migrations_controller.rb
@@ -28,6 +28,7 @@ class Settings::MigrationsController < ApplicationController
   end
 
   def migration_account_changed?
-    current_account.moved_to_account_id != @migration.account&.id
+    current_account.moved_to_account_id != @migration.account&.id &&
+      current_account.id != @migration.account&.id
   end
 end