Commit ebfef58a386b2fb0ae6c67d6f3caa76c4d415b34
1 parent
9efcdbc1
Exists in
master
and in
2 other branches
Fix bug on rating organization
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
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 |