Skip to content
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

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

Open
BjornHeller opened this issue Jan 26, 2022 · 0 comments

Comments

@BjornHeller
Copy link

BjornHeller commented Jan 26, 2022

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 BjornHeller changed the title category__in filters name=category_slug throws exception when slug is different from name Part-05: category__in filters name=category_slug throws exception when slug is different from name Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant