diff --git a/app/views/profile_editor/index.rhtml b/app/views/profile_editor/index.rhtml
index e6814d5..575ef51 100644
--- a/app/views/profile_editor/index.rhtml
+++ b/app/views/profile_editor/index.rhtml
@@ -62,7 +62,7 @@
<%= control_panel_button(_('Manage my groups'), 'groups', :controller => 'memberships') if profile.person? %>
<% end %>
- <% if environment.enabled?('enterprise_activation') %>
+ <% if profile.person? && environment.enabled?('enterprise_activation') %>
<% form_tag({:controller => 'account', :action => 'activation_question'}, {:method => 'get'}) do %>
diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb
index 806d1de..ba90fb3 100644
--- a/test/functional/profile_editor_controller_test.rb
+++ b/test/functional/profile_editor_controller_test.rb
@@ -712,5 +712,17 @@ class ProfileEditorControllerTest < Test::Unit::TestCase
assert_tag :tag => 'div', :attributes => { :id => 'activation_enterprise' }, :descendant => {:tag => 'form', :attributes => {:action => '/account/activation_question'}}
end
+ should 'not display enterprise activation to enterprises' do
+ env = Environment.default
+ env.enable('enterprise_activation')
+ env.save!
+
+ enterprise = Enterprise.create!(:name => 'bli', :identifier => 'bli')
+ enterprise.add_admin(profile)
+
+ get :index, :profile => enterprise.identifier
+ assert_no_tag :tag => 'div', :attributes => { :id => 'activation_enterprise' }, :descendant => {:tag => 'form', :attributes => {:action => '/account/activation_question'}}
+ end
+
end
--
libgit2 0.21.2