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:
'from django.core import cache'
instead of
'from django.core.cache import cache'
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.
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:
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.