Commit a112aae2591e1ec33899740352634270be2ffdbf

Authored by Parley
Committed by Gabriela Navarro
1 parent 9f951635
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Remove captcha from create institution

Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Signed-off-by: Parley Martins <parley@outlook.com>
controllers/mpog_software_plugin_controller.rb
@@ -47,20 +47,16 @@ class MpogSoftwarePluginController &lt; ApplicationController @@ -47,20 +47,16 @@ class MpogSoftwarePluginController &lt; ApplicationController
47 end 47 end
48 48
49 def new_institution 49 def new_institution
50 - if request.xhr? and !params[:community].nil? and !params[:institution].nil? and !params[:recaptcha_response_field].nil? 50 + if request.xhr? and !params[:community].nil? and !params[:institution].nil?
51 response_message = {} 51 response_message = {}
52 52
53 institution = private_create_institution 53 institution = private_create_institution
54 54
55 - response_message = if verify_recaptcha(:model=> institution, :message => _('Please type the word correctly'))  
56 - if institution.errors.full_messages.empty? and institution.valid? and institution.save 55 + response_message = if institution.errors.full_messages.empty? and institution.valid? and institution.save
57 {:success => true, :message => _("Institution successful created!"), :institution_data=>{:name=>institution.name, :id=>institution.id}} 56 {:success => true, :message => _("Institution successful created!"), :institution_data=>{:name=>institution.name, :id=>institution.id}}
58 else 57 else
59 {:success => false, :message => _("Institution could not be created!"), :errors => institution.errors.full_messages} 58 {:success => false, :message => _("Institution could not be created!"), :errors => institution.errors.full_messages}
60 end 59 end
61 - else  
62 - {:success => false, :message=>_('Please type the image text correctly'), :errors=>[]}  
63 - end  
64 60
65 render :json => response_message.to_json 61 render :json => response_message.to_json
66 else 62 else
public/mpog-institution-validations.js
@@ -65,9 +65,6 @@ @@ -65,9 +65,6 @@
65 type: get_selected_institution_type(), 65 type: get_selected_institution_type(),
66 acronym : jQuery("#institutions_acronym").val(), 66 acronym : jQuery("#institutions_acronym").val(),
67 }, 67 },
68 - authenticity_token : jQuery("input[name='authenticity_token']").val(),  
69 - recaptcha_response_field : jQuery('#recaptcha_response_field').val(),  
70 - recaptcha_challenge_field : jQuery('#recaptcha_challenge_field').val()  
71 } 68 }
72 } 69 }
73 70
views/mpog_software_plugin/create_institution.html.erb
@@ -92,7 +92,6 @@ @@ -92,7 +92,6 @@
92 <br /> 92 <br />
93 93
94 <div> 94 <div>
95 - <p><%= recaptcha_tags :ajax => true, :display => {:theme => 'clean'} %> </p>  
96 <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %> 95 <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %>
97 </div> 96 </div>
98 <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %> 97 <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %>