django-ecommerce-project icon indicating copy to clipboard operation
django-ecommerce-project copied to clipboard

Part-05: category__in filters name=category_slug throws exception when slug is different from name

Open BjornHeller opened this issue 3 years ago • 0 comments

in store>view.py line 13

category__in=Category.objects.get(name=category_slug).get_descendants(include_self=True)

should most likely be

category__in=Category.objects.get(name=category).get_descendants(include_self=True)

if the slug and the category name does not match, it throws and exception in the original code. The category name is already retrieved in line 13.

BjornHeller avatar Jan 26 '22 20:01 BjornHeller