Sometimes customers get CSRF error when adding a product to the cart or switching ordering on categories listing page.
The problem is caused by cached version of product_inline and other templates. product_inline caches generated HTML including csrf_token and if the token is changed on server for any reason, the cached HTML is not updated.
Sometimes customers get CSRF error when adding a product to the cart or switching ordering on categories listing page.
The problem is caused by cached version of product_inline and other templates. product_inline caches generated HTML including csrf_token and if the token is changed on server for any reason, the cached HTML is not updated.
Related code: https://github.com/diefenbach/django-lfs/blob/master/lfs/catalog/views.py#L486 or https://github.com/diefenbach/django-lfs/blob/master/lfs/catalog/views.py#L365
The problem can appear everywhere full HTML including csrf_token is cached.