server/session.py
changeset 2604 6b55a2a81fd8
parent 2603 e47d63351891
child 2616 4501ee760eec
equal deleted inserted replaced
2603:e47d63351891 2604:6b55a2a81fd8
    71         self._closed = False
    71         self._closed = False
    72 
    72 
    73     def __str__(self):
    73     def __str__(self):
    74         return '<%ssession %s (%s 0x%x)>' % (self.cnxtype, self.user.login,
    74         return '<%ssession %s (%s 0x%x)>' % (self.cnxtype, self.user.login,
    75                                              self.id, id(self))
    75                                              self.id, id(self))
       
    76 
       
    77     def add_relation(self, fromeid, rtype, toeid):
       
    78         if self.is_super_session:
       
    79             self.repo.glob_add_relation(self, fromeid, rtype, toeid)
       
    80             return
       
    81         self.is_super_session = True
       
    82         try:
       
    83             self.repo.glob_add_relation(self, fromeid, rtype, toeid)
       
    84         finally:
       
    85             self.is_super_session = False
       
    86 
    76     # resource accessors ######################################################
    87     # resource accessors ######################################################
    77 
    88 
    78     def actual_session(self):
    89     def actual_session(self):
    79         """return the original parent session if any, else self"""
    90         """return the original parent session if any, else self"""
    80         return self
    91         return self