Commit 4a4ec101f09f05c7fc62fd1bfd32f56b482727bb
Exists in
master
and in
2 other branches
Merge branch 'fix_bugs' into 'master'
Fix bugs See merge request !9
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
lib/ext/communities_block.rb
@@ -22,7 +22,7 @@ class CommunitiesBlock | @@ -22,7 +22,7 @@ class CommunitiesBlock | ||
22 | valid_communities_string = Community.get_valid_communities_string | 22 | valid_communities_string = Community.get_valid_communities_string |
23 | Community.all.each{|community| delete_communities << community.id unless eval(valid_communities_string)} | 23 | Community.all.each{|community| delete_communities << community.id unless eval(valid_communities_string)} |
24 | 24 | ||
25 | - visible_profiles = visible_profiles.where(["profiles.id NOT IN (?)", delete_communities]) | 25 | + visible_profiles = visible_profiles.where(["profiles.id NOT IN (?)", delete_communities]) unless delete_communities.empty? |
26 | 26 | ||
27 | if !prioritize_profiles_with_image | 27 | if !prioritize_profiles_with_image |
28 | return visible_profiles.all( | 28 | return visible_profiles.all( |
lib/gov_user_plugin.rb
@@ -236,12 +236,14 @@ class GovUserPlugin < Noosfero::Plugin | @@ -236,12 +236,14 @@ class GovUserPlugin < Noosfero::Plugin | ||
236 | end | 236 | end |
237 | 237 | ||
238 | def organization_ratings_plugin_extra_fields_show_data user_rating | 238 | def organization_ratings_plugin_extra_fields_show_data user_rating |
239 | + gov_user_self = self | ||
240 | + | ||
239 | Proc::new { | 241 | Proc::new { |
240 | if logged_in? | 242 | if logged_in? |
241 | is_admin = environment.admins.include?(current_user.person) | 243 | is_admin = environment.admins.include?(current_user.person) |
242 | is_admin ||= user_rating.organization.admins.include?(current_user.person) | 244 | is_admin ||= user_rating.organization.admins.include?(current_user.person) |
243 | 245 | ||
244 | - if is_admin and context.profile.software? | 246 | + if is_admin and gov_user_self.context.profile.software? |
245 | render :file => 'organization_ratings_extra_fields_show_institution', | 247 | render :file => 'organization_ratings_extra_fields_show_institution', |
246 | :locals => {:user_rating => user_rating} | 248 | :locals => {:user_rating => user_rating} |
247 | end | 249 | end |