server/session.py
changeset 10360 1fdbe2ea63d8
parent 10359 8e4ba1028f55
child 10361 46d72f33c428
equal deleted inserted replaced
10359:8e4ba1028f55 10360:1fdbe2ea63d8
   534         return self.session.repo.get_option_value(option)
   534         return self.session.repo.get_option_value(option)
   535 
   535 
   536     # transaction api
   536     # transaction api
   537 
   537 
   538     @_open_only
   538     @_open_only
   539     def undoable_transactions(self, ueid=None, req=None, **actionfilters):
   539     def undoable_transactions(self, ueid=None, **actionfilters):
   540         """Return a list of undoable transaction objects by the connection's
   540         """Return a list of undoable transaction objects by the connection's
   541         user, ordered by descendant transaction time.
   541         user, ordered by descendant transaction time.
   542 
   542 
   543         Managers may filter according to user (eid) who has done the transaction
   543         Managers may filter according to user (eid) who has done the transaction
   544         using the `ueid` argument. Others will only see their own transactions.
   544         using the `ueid` argument. Others will only see their own transactions.
   557 
   557 
   558         * `public`: when additional filtering is provided, they are by default
   558         * `public`: when additional filtering is provided, they are by default
   559           only searched in 'public' actions, unless a `public` argument is given
   559           only searched in 'public' actions, unless a `public` argument is given
   560           and set to false.
   560           and set to false.
   561         """
   561         """
   562         source = self.repo.system_source
   562         return self.repo.system_source.undoable_transactions(self, ueid,
   563         txinfos = source.undoable_transactions(self, ueid, **actionfilters)
   563                                                              **actionfilters)
   564         for txinfo in txinfos:
   564 
   565             txinfo.req = req or self
   565     @_open_only
   566         return txinfos
   566     def transaction_info(self, txuuid):
   567 
       
   568     @_open_only
       
   569     def transaction_info(self, txuuid, req=None):
       
   570         """Return transaction object for the given uid.
   567         """Return transaction object for the given uid.
   571 
   568 
   572         raise `NoSuchTransaction` if not found or if session's user is
   569         raise `NoSuchTransaction` if not found or if session's user is
   573         not allowed (eg not in managers group and the transaction
   570         not allowed (eg not in managers group and the transaction
   574         doesn't belong to him).
   571         doesn't belong to him).
   575         """
   572         """
   576         txinfo = self.repo.system_source.tx_info(self, txuuid)
   573         return self.repo.system_source.tx_info(self, txuuid)
   577         if req:
       
   578             txinfo.req = req
       
   579         else:
       
   580             txinfo.cnx = self
       
   581         return txinfo
       
   582 
   574 
   583     @_open_only
   575     @_open_only
   584     def transaction_actions(self, txuuid, public=True):
   576     def transaction_actions(self, txuuid, public=True):
   585         """Return an ordered list of actions effectued during that transaction.
   577         """Return an ordered list of actions effectued during that transaction.
   586 
   578