diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-01 11:58:43 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-01 11:58:43 +0000 |
commit | ac35636f4ad92a2f3080af556ad8cfadf73ce977 (patch) | |
tree | 4b5d390aba29aad7866b9d3608b87df171cdf5ff | |
parent | 4780e747711c74fbd7824f3209ccb2779b89cb88 (diff) | |
parent | b8f5a7d5e904ca41a9f7cf97d3eb0f9fa0249240 (diff) | |
download | gitlab-ce-ac35636f4ad92a2f3080af556ad8cfadf73ce977.tar.gz |
Merge branch 'sh-fix-spam-update-404' into 'master'
Fix 404 error after a user edits an issue description and solves the reCAPTCHA
Closes #41445
See merge request gitlab-org/gitlab-ce!16167
-rw-r--r-- | app/views/shared/_recaptcha_form.html.haml | 3 | ||||
-rw-r--r-- | changelogs/unreleased/sh-fix-spam-update-404.yml | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/views/shared/_recaptcha_form.html.haml b/app/views/shared/_recaptcha_form.html.haml index 0e816870f15..93a4301f366 100644 --- a/app/views/shared/_recaptcha_form.html.haml +++ b/app/views/shared/_recaptcha_form.html.haml @@ -1,9 +1,10 @@ - resource_name = spammable.class.model_name.singular - humanized_resource_name = spammable.class.model_name.human.downcase - script = local_assigns.fetch(:script, true) +- method = params[:action] == 'create' ? :post : :put - has_submit = local_assigns.fetch(:has_submit, true) -= form_for resource_name, method: :post, html: { class: 'recaptcha-form js-recaptcha-form' } do |f| += form_for resource_name, method: method, html: { class: 'recaptcha-form js-recaptcha-form' } do |f| .recaptcha - params[resource_name].each do |field, value| = hidden_field(resource_name, field, value: value) diff --git a/changelogs/unreleased/sh-fix-spam-update-404.yml b/changelogs/unreleased/sh-fix-spam-update-404.yml new file mode 100644 index 00000000000..13daec35ecf --- /dev/null +++ b/changelogs/unreleased/sh-fix-spam-update-404.yml @@ -0,0 +1,5 @@ +--- +title: Fix 404 errors after a user edits an issue description and solves the reCAPTCHA +merge_request: +author: +type: fixed |