You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On upgrade to Django 4.2 in our project and using django-selectable==1.4.0 a problem is present with the @ajax_required decorator where it is using the removed is_ajax method.
The HttpRequest.is_ajax() method is deprecated as it relied on a jQuery-specific way of signifying AJAX calls, while current usage tends to use the JavaScript Fetch API. Depending on your use case, you can either write your own AJAX detection method, or use the new HttpRequest.accepts() method if your code depends on the client Accept HTTP header.
If you are writing your own AJAX detection method, request.is_ajax() can be reproduced exactly as request.headers.get('x-requested-with') == 'XMLHttpRequest'.
The text was updated successfully, but these errors were encountered:
Hi 👋
On upgrade to Django 4.2 in our project and using django-selectable==1.4.0 a problem is present with the
@ajax_required
decorator where it is using the removedis_ajax
method.https://github.com/mlavin/django-selectable/blob/master/selectable/decorators.py#L44-L47
This was removed in Django 4.0 here https://docs.djangoproject.com/en/4.2/releases/4.0/#features-removed-in-4-0
Notes from Django 3.1 deprecation notice:
The text was updated successfully, but these errors were encountered: