summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-01-01 11:58:43 +0000
committerTiago <tiagonbotelho@hotmail.com>2018-01-02 11:39:03 +0000
commitf5c2ad7fd86a5801aad4c2fb58104d212e0ae6a1 (patch)
tree6be04271609791c1004c940b9542440f2849b0cc
parente0d6049d370d1bda44f68bcebfd5f36521f28e3a (diff)
downloadgitlab-ce-10-3-stable-patch-3.tar.gz
Merge branch 'sh-fix-spam-update-404' into 'master'10-3-stable-patch-3
Fix 404 error after a user edits an issue description and solves the reCAPTCHA Closes #41445 See merge request gitlab-org/gitlab-ce!16167 (cherry picked from commit ac35636f4ad92a2f3080af556ad8cfadf73ce977) b8f5a7d5 Fix 404 error after a user edits an issue description and solves the reCAPTCHA
-rw-r--r--app/views/shared/_recaptcha_form.html.haml3
-rw-r--r--changelogs/unreleased/sh-fix-spam-update-404.yml5
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