Fix the owner attribution of calendars
This commit is contained in:
parent
4a630397ce
commit
6bbf3f624f
@ -171,11 +171,15 @@ class Calendar(object):
|
|||||||
"""
|
"""
|
||||||
self.encoding = "utf-8"
|
self.encoding = "utf-8"
|
||||||
split_path = path.split("/")
|
split_path = path.split("/")
|
||||||
if (principal and split_path) or len(split_path) > 1:
|
self.path = os.path.join(FOLDER, path.replace("/", os.sep))
|
||||||
|
if principal and split_path and os.path.isdir(self.path):
|
||||||
|
# Already existing principal calendar
|
||||||
self.owner = split_path[0]
|
self.owner = split_path[0]
|
||||||
|
elif len(split_path) > 1:
|
||||||
|
# URL with at least one folder
|
||||||
|
self.owner = split_path[-1]
|
||||||
else:
|
else:
|
||||||
self.owner = None
|
self.owner = None
|
||||||
self.path = os.path.join(FOLDER, path.replace("/", os.sep))
|
|
||||||
self.local_path = path if path != '.' else ''
|
self.local_path = path if path != '.' else ''
|
||||||
self.is_principal = principal
|
self.is_principal = principal
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user