Commit 4a4ec101f09f05c7fc62fd1bfd32f56b482727bb

Authored by Thiago Ribeiro
2 parents 481d59ae ebfef58a

Merge branch 'fix_bugs' into 'master'

Fix bugs

See merge request !9
lib/ext/communities_block.rb
... ... @@ -22,7 +22,7 @@ class CommunitiesBlock
22 22 valid_communities_string = Community.get_valid_communities_string
23 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 27 if !prioritize_profiles_with_image
28 28 return visible_profiles.all(
... ...
lib/gov_user_plugin.rb
... ... @@ -236,12 +236,14 @@ class GovUserPlugin &lt; Noosfero::Plugin
236 236 end
237 237  
238 238 def organization_ratings_plugin_extra_fields_show_data user_rating
  239 + gov_user_self = self
  240 +
239 241 Proc::new {
240 242 if logged_in?
241 243 is_admin = environment.admins.include?(current_user.person)
242 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 247 render :file => 'organization_ratings_extra_fields_show_institution',
246 248 :locals => {:user_rating => user_rating}
247 249 end
... ...