1 ##parameters=text, text_format, SafetyBelt='', **kw
3 from Products
.CMFDefault
.exceptions
import EditingConflict
4 from Products
.CMFDefault
.exceptions
import ResourceLockedError
6 if text_format
!= context
.text_format
or text
!= context
.text
:
8 context
.edit(text
, text_format
= text_format
)#, safety_belt=SafetyBelt)
9 return context
.setStatus(True, 'Document changed.')
10 except (ResourceLockedError
, EditingConflict
), errmsg
:
11 return context
.setStatus(False, errmsg
)
13 return context
.setStatus(False, 'Nothing to change.')