Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Autocomplete requires POST request but receives GET requests #142

Open
simon-retsch opened this issue Feb 3, 2023 · 3 comments
Open

Comments

@simon-retsch
Copy link
Contributor

Problem

Since this PR merge autocomplete/search requires POST requests. I experienced the following error with this, showing in django log while trying to search for something in the autocomplete field:
django.request WARNING 2023-01-31 10:08:10,155 log Method Not Allowed (GET): /autocomplete/search/

We are using django v3.2 and wagtail v2.16.2. We were using no specific version, but the latest commit in the main branch.

Has anyone experienced the same error or does someone know a fix around it?

How to Reproduce

We were not able to reproduce this error on purpose, sometimes it did not come up. But when it did it could be resolved by either rebuilding our VSC docker devcontainer without cache, or clear the python cache and reload.

Reason

I'm not that experienced with wagtail, but I assume that some part of django/wagtail does not yet know that it needs to send POST requests instead of GET requests, which should be clear by the changed autocomplete library. Somehow it gets clear when the Python cache is cleared.

@simon-retsch
Copy link
Contributor Author

@joeyjurjens, @chigby did also run into the described problem at some point?

@joeyjurjens
Copy link
Contributor

@joeyjurjens, @chigby did also run into the described problem at some point?

Hi, no I did not run into this problem.

You're saying the following;
"We were not able to reproduce this error on purpose, sometimes it did not come up. But when it did it could be resolved by either rebuilding our VSC docker devcontainer without cache, or clear the python cache and reload"

After it's resolved? Does it come back again or is it then fixed for good?

Cause if it doesn't come back, can't it be some kind of static file caching? Or that you have to run the collectstatic command?

@simon-retsch
Copy link
Contributor Author

After it's resolved? Does it come back again or is it then fixed for good?

After resolving the problem by cleaning the cache, it did not come up anymore.

Cause if it doesn't come back, can't it be some kind of static file caching? Or that you have to run the collectstatic command?

Hmm good point, but the collectstatic command should be run on every CI build, so it should be fine. But I have it in mind and will try that if it appears again locally. Thanks for the answer 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants