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,20 +47,16 @@ class MpogSoftwarePluginController < 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") %> |