|
@@ -1,6 +1,7 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
import uuid
|
3
|
3
|
|
|
4
|
+import pytz
|
4
|
5
|
from tracim import model as pm
|
5
|
6
|
|
6
|
7
|
from sprox.tablebase import TableBase
|
|
@@ -380,15 +381,18 @@ class UserRestController(TIMRestController):
|
380
|
381
|
user = api.get_one(id)
|
381
|
382
|
|
382
|
383
|
dictified_user = Context(CTX.USER).toDict(user, 'user')
|
383
|
|
- return DictLikeClass(result = dictified_user)
|
|
384
|
+ return DictLikeClass(
|
|
385
|
+ result=dictified_user,
|
|
386
|
+ timezones=pytz.all_timezones,
|
|
387
|
+ )
|
384
|
388
|
|
385
|
389
|
@tg.require(predicates.in_group(Group.TIM_MANAGER_GROUPNAME))
|
386
|
390
|
@tg.expose()
|
387
|
|
- def put(self, user_id, name, email, next_url=''):
|
|
391
|
+ def put(self, user_id, name, email, timezone: str='', next_url=''):
|
388
|
392
|
api = UserApi(tmpl_context.current_user)
|
389
|
393
|
|
390
|
394
|
user = api.get_one(int(user_id))
|
391
|
|
- api.update(user, name, email, True)
|
|
395
|
+ api.update(user, name, email, True, timezone=timezone)
|
392
|
396
|
|
393
|
397
|
tg.flash(_('User {} updated.').format(user.get_display_name()), CST.STATUS_OK)
|
394
|
398
|
if next_url:
|