Commit f70897fc9aa51552b173193ee1abb2463b81c5f9
1 parent
64ff46bf
Exists in
master
and in
5 other branches
Refactor hotspots
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
1 changed file
with
0 additions
and
31 deletions
Show diff stats
lib/mpog_software_plugin.rb
| ... | ... | @@ -177,24 +177,6 @@ class MpogSoftwarePlugin < Noosfero::Plugin |
| 177 | 177 | end |
| 178 | 178 | end |
| 179 | 179 | |
| 180 | - def custom_user_registration_attributes user | |
| 181 | - unless context.params[:user][:institution_ids].nil? | |
| 182 | - context.params[:user][:institution_ids].delete("") | |
| 183 | - | |
| 184 | - context.params[:user][:institution_ids].each do |institution_id| | |
| 185 | - institution = Institution.find institution_id | |
| 186 | - user.institutions << institution | |
| 187 | - institution.community.add_admin(user.person) if institution.community.admins.blank? | |
| 188 | - end | |
| 189 | - end | |
| 190 | - user.save unless user.institution_ids.empty? | |
| 191 | - | |
| 192 | - user.institutions.each do |institution| | |
| 193 | - community = institution.community | |
| 194 | - community.add_member user.person | |
| 195 | - end | |
| 196 | - end | |
| 197 | - | |
| 198 | 180 | def calc_percentage_registration person |
| 199 | 181 | required_list = profile_required_list |
| 200 | 182 | empty_fields = profile_required_empty_list person |
| ... | ... | @@ -352,19 +334,6 @@ class MpogSoftwarePlugin < Noosfero::Plugin |
| 352 | 334 | end |
| 353 | 335 | end |
| 354 | 336 | |
| 355 | - def add_new_search_filter | |
| 356 | - if context.params[:action] == "communities" | |
| 357 | - @active_type = if context.params[:type] == "Software" | |
| 358 | - "software" | |
| 359 | - elsif context.params[:type] == "Institution" | |
| 360 | - "institution" | |
| 361 | - else | |
| 362 | - "community" | |
| 363 | - end | |
| 364 | - expanded_template('search/search_community_filter.html.erb') | |
| 365 | - end | |
| 366 | - end | |
| 367 | - | |
| 368 | 337 | def software_categories_transaction |
| 369 | 338 | ControlledVocabulary.transaction do |
| 370 | 339 | context.profile.software_info.software_categories.update_attributes!(context.params[:software_categories]) | ... | ... |