diff --git a/controllers/mpog_software_plugin_myprofile_controller.rb b/controllers/mpog_software_plugin_myprofile_controller.rb index 7a176d6..434d84d 100644 --- a/controllers/mpog_software_plugin_myprofile_controller.rb +++ b/controllers/mpog_software_plugin_myprofile_controller.rb @@ -64,7 +64,7 @@ class MpogSoftwarePluginMyprofileController < MyProfileController end end - if environment.enabled?("admin_must_approve_new_communities") + if environment.enabled?("admin_must_approve_new_communities") and !environment.admins.include?(current_user.person) session[:notice] = _('Your new software request will be evaluated by an administrator. You will be notified.') redirect_to user.admin_url else diff --git a/lib/ext/community.rb b/lib/ext/community.rb index c24f659..8374f47 100644 --- a/lib/ext/community.rb +++ b/lib/ext/community.rb @@ -4,8 +4,8 @@ class Community attr_accessible :visible - has_one :software_info, :dependent=>:delete - has_one :institution, :dependent=>:delete + has_one :software_info, :dependent=>:destroy + has_one :institution, :dependent=>:destroy def self.create_after_moderation(requestor, attributes = {}, software_info = nil, license_info = nil, software_categories = nil) community = Community.new(attributes) @@ -21,7 +21,7 @@ class Community software_info.save end - if community.environment.enabled?('admin_must_approve_new_communities') + if community.environment.enabled?('admin_must_approve_new_communities') and !community.environment.admins.include?(requestor) cc = CreateCommunity.create(attributes.merge(:requestor => requestor, :software_info=>software_info)) else community = Community.create(attributes) -- libgit2 0.21.2