diff --git a/controllers/mpog_software_plugin_myprofile_controller.rb b/controllers/mpog_software_plugin_myprofile_controller.rb index 4ea9598..f4c33f1 100644 --- a/controllers/mpog_software_plugin_myprofile_controller.rb +++ b/controllers/mpog_software_plugin_myprofile_controller.rb @@ -92,7 +92,8 @@ class MpogSoftwarePluginMyprofileController < MyProfileController begin governmental_updates rescue - @institution.errors.add(:governmental_fields, _("Could not find Governmental Power or Governmental Sphere")) + @institution.errors.add(:governmental_fields, + _("Could not find Governmental Power or Governmental Sphere")) end end flash[:errors] = @institution.errors.full_messages unless @institution.valid? diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index a5ba01c..9161691 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -144,16 +144,16 @@ class MpogSoftwarePlugin < Noosfero::Plugin end def profile_blocks_extra_content - return if context.session[:user].nil? or - !!context.session[:hide_incomplete_percentage] + return if context.session[:user].nil? || + !context.session[:hide_incomplete_percentage].blank? person = Person.where(:user_id=>context.session[:user]).first - if context.profile && context.profile.person? and !person.nil? + if context.profile && context.profile.person? && !person.nil? @person = person @percentege = calc_percentage_registration(person) - if @percentege >= 0 and @percentege <= 100 + if @percentege >= 0 && @percentege <= 100 expanded_template('incomplete_registration.html.erb') end end -- libgit2 0.21.2