Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Saving a plugin which include an image performs two identical save requests #6545
I developed this Django application than i use into a project:
The bug occurs on plugins: Card, Hero and Album but not on Slider.
I should be able to create one plugin object which include an image without to reload or have duplicated object.
When creating or editing an object of one involved plugin, i got an Error 500
But finally if i just reload the document, the object is well saved in its placeholder with filled data.
From what i find in the development server output the POST request is made twice which may trigger the database lock:
It is only happening if i fill an image field but if i just fill the text and choices the bug never happen.
This is the bug result on development mode (Debug enabled and SQLite database).
On production environment (Debug disabled and PostgreSQL database), there is rarely an http500 instead the two identical requests succeed but the same object is saved twice.
I tried many changes on my plugins to find something wrong, i searched in every issues related to plugins, searched in mailing list and i didn't find anything that would resolve this bug.
After many tests i found that bug (which trigger twice the POST request to
It does not happen with:
It does happen with:
I have a similar issue in a similar environment. In the browser network tab it looks like this:
The stack trace is slightly different:
I could only reproduce this issue with Firefox 62/63. Disabling browser plugins didn't seem to have an effect.
@Pankrat well you are not ending on "database locked" or duplicate object probably because your plugin have some field with unique clause, like a slug or custom id.
What i am wondering is that does your plugin have some image or file field ? Because i thought this bug of twice requests was related to image/file field that confused some code from cms frontend.