|
@@ -22,6 +22,7 @@ from tracim.model.data import Workspace
|
22
|
22
|
|
23
|
23
|
from tracim.model.serializers import Context, CTX, DictLikeClass
|
24
|
24
|
|
|
25
|
+from urllib.parse import urlparse
|
25
|
26
|
|
26
|
27
|
class UserWorkspaceRestController(TIMRestController):
|
27
|
28
|
|
|
@@ -100,12 +101,21 @@ class UserWorkspaceRestController(TIMRestController):
|
100
|
101
|
)
|
101
|
102
|
|
102
|
103
|
dictified_workspace = Context(CTX.WORKSPACE).toDict(workspace, 'workspace')
|
|
104
|
+
|
|
105
|
+ # INFO - G.M - 15-02-2018 - Deal with url scheme for dav link
|
|
106
|
+ # TODO - G.M - 15-02-2018 - Find better solution to deal with url ?
|
103
|
107
|
webdav_url = CFG.get_instance().WSGIDAV_CLIENT_BASE_URL
|
|
108
|
+ website_protocol = urlparse(CFG.get_instance().WEBSITE_BASE_URL).scheme
|
|
109
|
+ dav_protocol = 'dav'
|
|
110
|
+ if website_protocol == "https":
|
|
111
|
+ dav_protocol = 'davs'
|
104
|
112
|
|
105
|
113
|
return DictLikeClass(
|
106
|
114
|
result=dictified_workspace,
|
107
|
115
|
fake_api=fake_api,
|
108
|
116
|
webdav_url=webdav_url,
|
|
117
|
+ website_protocol = website_protocol,
|
|
118
|
+ dav_protocol = dav_protocol,
|
109
|
119
|
show_deleted=show_deleted,
|
110
|
120
|
show_archived=show_archived,
|
111
|
121
|
)
|