|
@@ -10,6 +10,7 @@ from tracim.controllers import TIMRestPathContextSetup
|
10
|
10
|
|
11
|
11
|
from tracim.lib import CST
|
12
|
12
|
from tracim.lib.base import BaseController
|
|
13
|
+from tracim.lib.helpers import on_off_to_boolean
|
13
|
14
|
from tracim.lib.user import UserApi
|
14
|
15
|
from tracim.lib.userworkspace import RoleApi
|
15
|
16
|
from tracim.lib.content import ContentApi
|
|
@@ -191,10 +192,11 @@ class WorkspaceRestController(TIMRestController, BaseController):
|
191
|
192
|
return dict(result = dictified_workspace, fake_api = fake_api)
|
192
|
193
|
|
193
|
194
|
@tg.expose()
|
194
|
|
- def post(self, name, description, calendar_enabled=False):
|
|
195
|
+ def post(self, name, description, calendar_enabled: str='off'):
|
195
|
196
|
# FIXME - Check user profile
|
196
|
197
|
user = tmpl_context.current_user
|
197
|
198
|
workspace_api_controller = WorkspaceApi(user)
|
|
199
|
+ calendar_enabled = on_off_to_boolean(calendar_enabled)
|
198
|
200
|
|
199
|
201
|
workspace = workspace_api_controller.create_workspace(name, description)
|
200
|
202
|
workspace.calendar_enabled = calendar_enabled
|
|
@@ -215,9 +217,10 @@ class WorkspaceRestController(TIMRestController, BaseController):
|
215
|
217
|
return DictLikeClass(result = dictified_workspace)
|
216
|
218
|
|
217
|
219
|
@tg.expose('tracim.templates.workspace.edit')
|
218
|
|
- def put(self, id, name, description, calendar_enabled=False):
|
|
220
|
+ def put(self, id, name, description, calendar_enabled: str='off'):
|
219
|
221
|
user = tmpl_context.current_user
|
220
|
222
|
workspace_api_controller = WorkspaceApi(user)
|
|
223
|
+ calendar_enabled = on_off_to_boolean(calendar_enabled)
|
221
|
224
|
|
222
|
225
|
workspace = workspace_api_controller.get_one(id)
|
223
|
226
|
workspace.label = name
|