add category view url with id instead of slug to make BlogCategory.get_absolute_url() work in any case

This commit is contained in:
Tadas Dailyda 2015-02-13 17:30:20 +00:00
parent 74a78fc5a4
commit f55af7d036

View file

@ -15,12 +15,12 @@ class BlogCategoryMenu(CMSAttachMenu):
def get_nodes(self, request):
nodes = []
qs = BlogCategory.objects.translated(get_language())
qs = qs.order_by('parent_id', 'translations__name').distinct()
qs = qs.order_by('parent_id', 'translations__name')
for category in qs:
kwargs = { 'category': category.slug }
node = NavigationNode(
category.name,
reverse('djangocms_blog:posts-category', kwargs=kwargs),
category.get_absolute_url(),
category.pk,
category.parent_id
)