Fix 404 error after a user edits an issue description and solves the reCAPTCHA
When editing an issue, use the PUT method instead of POST to avoid a 404 after solving the reCAPTCHA. Closes #41445
This commit is contained in:
parent
ff077cf7dc
commit
b8f5a7d5e9
2 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
5
changelogs/unreleased/sh-fix-spam-update-404.yml
Normal file
5
changelogs/unreleased/sh-fix-spam-update-404.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fix 404 errors after a user edits an issue description and solves the reCAPTCHA
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
Loading…
Reference in a new issue