|
@@ -71,16 +71,30 @@ class CalendarManager(object):
|
71
|
71
|
return os.path.join(cfg.RADICALE_CLIENT_BASE_URL_TEMPLATE, 'workspace/')
|
72
|
72
|
|
73
|
73
|
@classmethod
|
74
|
|
- def get_user_calendar_url(cls, user_id: int):
|
|
74
|
+ def get_user_calendar_url(
|
|
75
|
+ cls,
|
|
76
|
+ user_id: int,
|
|
77
|
+ low_level: bool=False,
|
|
78
|
+ ):
|
75
|
79
|
user_path = CALENDAR_USER_URL_TEMPLATE.format(id=str(user_id))
|
76
|
|
- return os.path.join(cls.get_base_url(), user_path)
|
|
80
|
+ return os.path.join(
|
|
81
|
+ cls.get_base_url(low_level=low_level),
|
|
82
|
+ user_path,
|
|
83
|
+ )
|
77
|
84
|
|
78
|
85
|
@classmethod
|
79
|
|
- def get_workspace_calendar_url(cls, workspace_id: int):
|
|
86
|
+ def get_workspace_calendar_url(
|
|
87
|
+ cls,
|
|
88
|
+ workspace_id: int,
|
|
89
|
+ low_level: bool=False,
|
|
90
|
+ ):
|
80
|
91
|
workspace_path = CALENDAR_WORKSPACE_URL_TEMPLATE.format(
|
81
|
92
|
id=str(workspace_id)
|
82
|
93
|
)
|
83
|
|
- return os.path.join(cls.get_base_url(), workspace_path)
|
|
94
|
+ return os.path.join(
|
|
95
|
+ cls.get_base_url(low_level=low_level),
|
|
96
|
+ workspace_path,
|
|
97
|
+ )
|
84
|
98
|
|
85
|
99
|
def __init__(self, user: User):
|
86
|
100
|
self._user = user
|
|
@@ -340,9 +354,15 @@ class CalendarManager(object):
|
340
|
354
|
password=self._user.auth_token,
|
341
|
355
|
)
|
342
|
356
|
if calendar_class == WorkspaceCalendar:
|
343
|
|
- calendar_url = self.get_workspace_calendar_url(related_object_id)
|
|
357
|
+ calendar_url = self.get_workspace_calendar_url(
|
|
358
|
+ related_object_id,
|
|
359
|
+ low_level=True,
|
|
360
|
+ )
|
344
|
361
|
elif calendar_class == UserCalendar:
|
345
|
|
- calendar_url = self.get_user_calendar_url(related_object_id)
|
|
362
|
+ calendar_url = self.get_user_calendar_url(
|
|
363
|
+ related_object_id,
|
|
364
|
+ low_level=True,
|
|
365
|
+ )
|
346
|
366
|
else:
|
347
|
367
|
raise Exception('Unknown calendar type {0}'.format(calendar_class))
|
348
|
368
|
|