web/controller.py
branchstable
changeset 6866 51d7868264b1
parent 6542 f13c47ac9137
child 7293 97505b798975
equal deleted inserted replaced
6865:89ecbae8f9be 6866:51d7868264b1
   146         elif '__redirectpath' in self._cw.form:
   146         elif '__redirectpath' in self._cw.form:
   147             # if redirect path was explicitly specified in the form, use it
   147             # if redirect path was explicitly specified in the form, use it
   148             path = self._cw.form['__redirectpath']
   148             path = self._cw.form['__redirectpath']
   149             if (self._edited_entity and path != self._edited_entity.rest_path()
   149             if (self._edited_entity and path != self._edited_entity.rest_path()
   150                 and '_cwmsgid' in newparams):
   150                 and '_cwmsgid' in newparams):
   151                 # XXX may be here on modification?
   151                 # are we here on creation or modification?
   152                 msg = u'(<a href="%s">%s</a>)' % (
   152                 if any(eid == self._edited_entity.eid
   153                     xml_escape(self._edited_entity.absolute_url()),
   153                        for eid in self._cw.data.get('eidmap', {}).values()):
   154                     self._cw._('click here to see created entity'))
   154                     msg = self._cw._('click here to see created entity')
       
   155                 else:
       
   156                     msg = self._cw._('click here to see edited entity')
       
   157                 msg = u'(<a href="%s">%s</a>)' % (xml_escape(self._edited_entity.absolute_url()), msg)
   155                 self._cw.append_to_redirect_message(msg)
   158                 self._cw.append_to_redirect_message(msg)
   156         elif self._after_deletion_path:
   159         elif self._after_deletion_path:
   157             # else it should have been set during form processing
   160             # else it should have been set during form processing
   158             path, params = self._after_deletion_path
   161             path, params = self._after_deletion_path
   159             params = dict(params) # params given as tuple
   162             params = dict(params) # params given as tuple