Commit e999d70352a977b4bf2c33c594d206b4b818c2c1
1 parent
74f7762e
Exists in
master
and in
5 other branches
Inprove myprofile_controller and mpog_software.
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: David Calos <ddavidcarlos1392@gmail.com>
Showing
2 changed files
with
6 additions
and
5 deletions
Show diff stats
controllers/mpog_software_plugin_myprofile_controller.rb
| @@ -92,7 +92,8 @@ class MpogSoftwarePluginMyprofileController < MyProfileController | @@ -92,7 +92,8 @@ class MpogSoftwarePluginMyprofileController < MyProfileController | ||
| 92 | begin | 92 | begin |
| 93 | governmental_updates | 93 | governmental_updates |
| 94 | rescue | 94 | rescue |
| 95 | - @institution.errors.add(:governmental_fields, _("Could not find Governmental Power or Governmental Sphere")) | 95 | + @institution.errors.add(:governmental_fields, |
| 96 | + _("Could not find Governmental Power or Governmental Sphere")) | ||
| 96 | end | 97 | end |
| 97 | end | 98 | end |
| 98 | flash[:errors] = @institution.errors.full_messages unless @institution.valid? | 99 | flash[:errors] = @institution.errors.full_messages unless @institution.valid? |
lib/mpog_software_plugin.rb
| @@ -144,16 +144,16 @@ class MpogSoftwarePlugin < Noosfero::Plugin | @@ -144,16 +144,16 @@ class MpogSoftwarePlugin < Noosfero::Plugin | ||
| 144 | end | 144 | end |
| 145 | 145 | ||
| 146 | def profile_blocks_extra_content | 146 | def profile_blocks_extra_content |
| 147 | - return if context.session[:user].nil? or | ||
| 148 | - !!context.session[:hide_incomplete_percentage] | 147 | + return if context.session[:user].nil? || |
| 148 | + !context.session[:hide_incomplete_percentage].blank? | ||
| 149 | 149 | ||
| 150 | person = Person.where(:user_id=>context.session[:user]).first | 150 | person = Person.where(:user_id=>context.session[:user]).first |
| 151 | 151 | ||
| 152 | - if context.profile && context.profile.person? and !person.nil? | 152 | + if context.profile && context.profile.person? && !person.nil? |
| 153 | @person = person | 153 | @person = person |
| 154 | @percentege = calc_percentage_registration(person) | 154 | @percentege = calc_percentage_registration(person) |
| 155 | 155 | ||
| 156 | - if @percentege >= 0 and @percentege <= 100 | 156 | + if @percentege >= 0 && @percentege <= 100 |
| 157 | expanded_template('incomplete_registration.html.erb') | 157 | expanded_template('incomplete_registration.html.erb') |
| 158 | end | 158 | end |
| 159 | end | 159 | end |