Back to index

plone3  3.1.7
newsitem_edit_control.py
Go to the documentation of this file.
00001 ##parameters=text_format, text, description='', **kw
00002 ##
00003 from Products.CMFDefault.exceptions import ResourceLockedError
00004 from Products.CMFDefault.utils import Message as _
00005 
00006 if description != context.Description() or \
00007         text_format != context.text_format or text != context.EditableBody():
00008     try:
00009         context.edit(text=text, description=description,
00010                      text_format=text_format)
00011         return context.setStatus(True, _(u'News Item changed.'))
00012     except ResourceLockedError, errmsg:
00013         return context.setStatus(False, errmsg)
00014 else:
00015     return context.setStatus(False, _(u'Nothing to change.'))