--- a/web/controller.py Fri Jan 21 12:02:36 2011 +0100
+++ b/web/controller.py Fri Jan 21 12:03:07 2011 +0100
@@ -148,10 +148,13 @@
path = self._cw.form['__redirectpath']
if (self._edited_entity and path != self._edited_entity.rest_path()
and '_cwmsgid' in newparams):
- # XXX may be here on modification?
- msg = u'(<a href="%s">%s</a>)' % (
- xml_escape(self._edited_entity.absolute_url()),
- self._cw._('click here to see created entity'))
+ # are we here on creation or modification?
+ if any(eid == self._edited_entity.eid
+ for eid in self._cw.data.get('eidmap', {}).values()):
+ msg = self._cw._('click here to see created entity')
+ else:
+ msg = self._cw._('click here to see edited entity')
+ msg = u'(<a href="%s">%s</a>)' % (xml_escape(self._edited_entity.absolute_url()), msg)
self._cw.append_to_redirect_message(msg)
elif self._after_deletion_path:
# else it should have been set during form processing