Add content.json location to getFileInfo

This commit is contained in:
shortcutme 2017-10-04 13:24:44 +02:00
parent 2ef537ee6c
commit 5dbaf02e33
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -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