-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Error in product.invalidate_cache() for product change #826
Comments
execut
added a commit
to execut/django-shop
that referenced
this issue
Dec 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While changing the product the following exception occurs:
…
self.save_model(request, new_object, form, not add)
File "/usr/local/lib/python3.6/site-packages/shop/admin/product.py", line 125, in save_model
product.invalidate_cache()
File "/usr/local/lib/python3.6/site-packages/shop/models/product.py", line 373, in invalidate_cache
cache.delete_pattern('product:{}|*'.format(self.id))
AttributeError: module 'django.core.cache' has no attribute 'delete_pattern'
Tested on demo shop made by cookiecutter for nginx docker and Redis cache selected.
Direct reason is using the following import:
instead of
Potential workaround is to override invalidate_cache() with proper import in custom product for user ‘myshop’ project but this is not right solution and should be fixed in django-shop.
The text was updated successfully, but these errors were encountered: