Back to index

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