Commit a112aae2591e1ec33899740352634270be2ffdbf
Committed by
Gabriela Navarro
1 parent
9f951635
Exists in
master
and in
5 other branches
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>
Showing
3 changed files
with
2 additions
and
10 deletions
Show diff stats
controllers/mpog_software_plugin_controller.rb
| ... | ... | @@ -47,20 +47,16 @@ class MpogSoftwarePluginController < ApplicationController |
| 47 | 47 | end |
| 48 | 48 | |
| 49 | 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 | 51 | response_message = {} |
| 52 | 52 | |
| 53 | 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 | 56 | {:success => true, :message => _("Institution successful created!"), :institution_data=>{:name=>institution.name, :id=>institution.id}} |
| 58 | 57 | else |
| 59 | 58 | {:success => false, :message => _("Institution could not be created!"), :errors => institution.errors.full_messages} |
| 60 | 59 | end |
| 61 | - else | |
| 62 | - {:success => false, :message=>_('Please type the image text correctly'), :errors=>[]} | |
| 63 | - end | |
| 64 | 60 | |
| 65 | 61 | render :json => response_message.to_json |
| 66 | 62 | else | ... | ... |
public/mpog-institution-validations.js
| ... | ... | @@ -65,9 +65,6 @@ |
| 65 | 65 | type: get_selected_institution_type(), |
| 66 | 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 | 92 | <br /> |
| 93 | 93 | |
| 94 | 94 | <div> |
| 95 | - <p><%= recaptcha_tags :ajax => true, :display => {:theme => 'clean'} %> </p> | |
| 96 | 95 | <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %> |
| 97 | 96 | </div> |
| 98 | 97 | <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %> | ... | ... |