Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def categories_list(context, categories_qs=None):
blog_page = context['blog_page']
if categories_qs:
categories = categories_qs.all()
else:
categories = Category.objects.with_uses(blog_page).filter(parent=None)
context['categories'] = categories
return context