Fix ssh key update logic. Refs #2162

This commit is contained in:
Pavel Chipiga 2011-10-29 16:21:04 +03:00
parent 8b2fdd71c7
commit 6b993db2fc
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class User < ActiveRecord::Base
create_ssh_key ssh_key
elsif ssh_key_was.present? and ssh_key.blank?
destroy_ssh_key ssh_key_was
elsif ssh_key_changed?
elsif ssh_key_changed? and ssh_key.present? and ssh_key_was.present?
update_ssh_key ssh_key_was, ssh_key
end
}