web/application.py
changeset 4913 083b4d454192
parent 4897 e402e0b32075
child 4914 dcb055f32d9b
equal deleted inserted replaced
4912:9767cc516b4f 4913:083b4d454192
   340                 raise
   340                 raise
   341             except Redirect:
   341             except Redirect:
   342                 # redirect is raised by edit controller when everything went fine,
   342                 # redirect is raised by edit controller when everything went fine,
   343                 # so try to commit
   343                 # so try to commit
   344                 try:
   344                 try:
   345                     req.cnx.commit()
   345                     txuuid = req.cnx.commit()
       
   346                     if txuuid is not None:
       
   347                         msg = u'<span class="undo">[<a href="%s">%s</a>]</span>' %(
       
   348                             req.build_url('undo', txuuid=txuuid), req._('undo'))
       
   349                         req.append_to_redirect_message(msg)
   346                 except ValidationError, ex:
   350                 except ValidationError, ex:
   347                     self.validation_error_handler(req, ex)
   351                     self.validation_error_handler(req, ex)
   348                 except Unauthorized, ex:
   352                 except Unauthorized, ex:
   349                     req.data['errmsg'] = req._('You\'re not authorized to access this page. '
   353                     req.data['errmsg'] = req._('You\'re not authorized to access this page. '
   350                                                'If you think you should, please contact the site administrator.')
   354                                                'If you think you should, please contact the site administrator.')