# Accepting "custom" flag returns 500 if post was edited in the meantime

**URL:** https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737
**Category:** Bug
**Created:** [25 oktober 2017 om 09:44 UTC](https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737 "2017-10-25T09:44:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sujan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sujan/32/70979_2.png) [@Sujan](https://meta.discourse.org/u/Sujan)
#### Post date: [25 oktober 2017 om 09:44 UTC](https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737/1 "2017-10-25T09:44:24Z")

</div>

There is a flag. It’s a custom one with a message from a user:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/d/9d703905a811812639236c93f7e556bfe2558a2e.png)

(Some other user didn’t format his code as code, so the post is pretty unreadable and 17 screens long.)

I agree, so I open the post and edit it.  
Now I have to close the flag. I do so by clicking “Agree” which brings up this modal:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/5/25d7edbe04ea1d963a66b236b4658321cf043add.png)

As I don’t want to hide the post, I click “Agree with flag”.

I get this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/1/e191be3123e3ff497d6f7d43a91e0a0ff5c8f194.png)

Here is a screenshot of Chrome devtools network panel:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/a/9abe558b3ac9abd3b0a3f92f19f4afa4bb3cf859.png)

First the flag is hidden, but if I reload the list it appears again.

Here is the response of the failing request in detail:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/6/5696e51bdbc67c0d33822a5ee6df5de3720f9a4a.png)

---

<div class="post-metadata">

### Author: ![Sujan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sujan/32/70979_2.png) [@Sujan](https://meta.discourse.org/u/Sujan)
#### Post date: [25 oktober 2017 om 09:44 UTC](https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737/2 "2017-10-25T09:44:50Z")

</div>

Feels pretty similar to

> [@"Akismet" plugin always returns "Sorry, an error has occured." although everything works as expected](https://meta.discourse.org/t/akismet-plugin-always-returns-sorry-an-error-has-occured-although-everything-works-as-expected/72672):
>
> Oh there is an Akismet report about a spam post: Nope, not spam. I click “Not Spam”. But I get “Sorry, an error has occured.”: But the report is gone: And the log shows that the post was correctly “confirmed not spam”: Anyone else having this problem?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [26 oktober 2017 om 01:40 UTC](https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737/3 "2017-10-26T01:40:15Z")

</div>

Possibly can we repro this @eviltrout?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [26 oktober 2017 om 18:51 UTC](https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737/5 "2017-10-26T18:51:25Z")

</div>

Legit bug, fixed here:

[https://github.com/discourse/discourse/commit/530624d438b863c4830936f091637370ce3dde8a](https://github.com/discourse/discourse/commit/530624d438b863c4830936f091637370ce3dde8a)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [27 oktober 2017 om 22:00 UTC](https://meta.discourse.org/t/accepting-custom-flag-returns-500-if-post-was-edited-in-the-meantime/72737/6 "2017-10-27T22:00:11Z")

</div>

This topic was automatically closed after 27 hours. New replies are no longer allowed.
