We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I'm having CSRF issues with wagtailautocomplete, on my dev platform (not yet deployed).
wagtailautocomplete
My CSRF settings:
CSRF_COOKIE_SAMESITE = "Strict" CSRF_COOKIE_SECURE = True CSRF_USE_SESSIONS = False
I'm using a autocomplete_custom_queryset_filter() method to filter the queryset.
autocomplete_custom_queryset_filter()
class Contact(models.Model): last_name = ... first_name = ... company = ... def autocomplete_label(self) -> str: return str(self) @staticmethod def autocomplete_custom_queryset_filter(search_term: str) -> QuerySet: return Contact.objects.filter( Q(first_name__icontains=search_term) | Q(last_name__icontains=search_term) | Q(company__icontains=search_term) )
The "client" model :
class EquipmentContact(models.Model): """M2M relation table.""" contact = models.ForeignKey(Contact) .... panels = [ AutocompletePanel("contact"), ... ]
What is weird is that I can see the X-CSRFToken in AJAX header AND the csrftoken in the cookies, but the request fails.
X-CSRFToken
csrftoken
Django: 4.2.x Wagtail: 6.3.2 wagtailautocomplete: 0.11.0
Thanks for your help !
The text was updated successfully, but these errors were encountered:
The request fails with a 403 status.
Sorry, something went wrong.
No branches or pull requests
Hi,
I'm having CSRF issues with
wagtailautocomplete
, on my dev platform (not yet deployed).My CSRF settings:
I'm using a
autocomplete_custom_queryset_filter()
method to filter the queryset.The "client" model :
What is weird is that I can see the
X-CSRFToken
in AJAX header AND thecsrftoken
in the cookies, but the request fails.Django: 4.2.x
Wagtail: 6.3.2
wagtailautocomplete: 0.11.0
Thanks for your help !
The text was updated successfully, but these errors were encountered: