|
@@ -18,6 +18,7 @@ from tracim.controllers import TIMWorkspaceContentRestController
|
18
|
18
|
from tracim.lib import CST
|
19
|
19
|
from tracim.lib.base import BaseController
|
20
|
20
|
from tracim.lib.base import logger
|
|
21
|
+from tracim.lib.utils import SameValueError
|
21
|
22
|
from tracim.lib.content import ContentApi
|
22
|
23
|
from tracim.lib.helpers import convert_id_into_instances
|
23
|
24
|
from tracim.lib.predicates import current_user_is_reader
|
|
@@ -426,6 +427,11 @@ class UserWorkspaceFolderPageRestController(TIMWorkspaceContentRestController):
|
426
|
427
|
tg.flash(msg, CST.STATUS_OK)
|
427
|
428
|
tg.redirect(self._std_url.format(tmpl_context.workspace_id, tmpl_context.folder_id, item.content_id))
|
428
|
429
|
|
|
430
|
+ except SameValueError as e:
|
|
431
|
+ msg = _('{} not updated: the content did not change').format(self._item_type_label)
|
|
432
|
+ tg.flash(msg, CST.STATUS_WARNING)
|
|
433
|
+ tg.redirect(self._err_url.format(tmpl_context.workspace_id, tmpl_context.folder_id, item_id))
|
|
434
|
+
|
429
|
435
|
except ValueError as e:
|
430
|
436
|
msg = _('{} not updated - error: {}').format(self._item_type_label, str(e))
|
431
|
437
|
tg.flash(msg, CST.STATUS_ERROR)
|