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
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.
The text was updated successfully, but these errors were encountered:
execut
added a commit
to execut/django-shop
that referenced
this issue
Dec 25, 2020
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: