django-ecommerce-project
django-ecommerce-project copied to clipboard
Part-05: category__in filters name=category_slug throws exception when slug is different from name
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.