From 04216e16e87e4144923da220042dc0d3b214679c Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 8 Jun 2016 11:51:37 +0200 Subject: [PATCH] correctly remove root from the category path --- api/models/category.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/models/category.py b/api/models/category.py index a55d895..ddb26c6 100644 --- a/api/models/category.py +++ b/api/models/category.py @@ -16,7 +16,7 @@ class Category(db.Model): if not row: raise Exception( 'Could not find a path for category: {}, locale: {}'.format(self.id, locale)) - path = row.path.replace('rot/', '', 1) + path = row.path.split('/', 1)[-1] # get all text after the first / path = slugify(path) return path