From 5dbaf02e335610e223d66f2f7933318bce2d1552 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 4 Oct 2017 13:24:44 +0200 Subject: [PATCH] Add content.json location to getFileInfo --- src/Content/ContentManager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index c8c11a0f..4a5affc7 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -330,8 +330,13 @@ class ContentManager(object): # Return the rules if user dir if content and "user_contents" in content: back = content["user_contents"] - # Content.json is in the users dir - back["content_inner_path"] = re.sub("(.*)/.*?$", "\\1/content.json", inner_path) + content_inner_path_dir = helper.getDirname(content_inner_path) + relative_content_path = inner_path[len(content_inner_path_dir):] + if "/" in relative_content_path: + user_auth_address = re.match("([A-Za-z0-9]+)/.*", relative_content_path).group(1) + back["content_inner_path"] = "%s%s/content.json" % (content_inner_path_dir, user_auth_address) + else: + back["content_inner_path"] = content_inner_path_dir + "content.json" back["optional"] = None return back