equal
deleted
inserted
replaced
153 def hijack_user(self, user): |
153 def hijack_user(self, user): |
154 """return a fake request/session using specified user""" |
154 """return a fake request/session using specified user""" |
155 session = Session(user, self.repo) |
155 session = Session(user, self.repo) |
156 threaddata = session._threaddata |
156 threaddata = session._threaddata |
157 threaddata.pool = self.pool |
157 threaddata.pool = self.pool |
|
158 # share pending_operations, else operation added in the hi-jacked |
|
159 # session such as SendMailOp won't ever be processed |
|
160 threaddata.pending_operations = self.pending_operations |
158 # everything in transaction_data should be copied back but the entity |
161 # everything in transaction_data should be copied back but the entity |
159 # type cache we don't want to avoid security pb |
162 # type cache we don't want to avoid security pb |
160 threaddata.transaction_data = self.transaction_data.copy() |
163 threaddata.transaction_data = self.transaction_data.copy() |
161 threaddata.transaction_data.pop('ecache', None) |
164 threaddata.transaction_data.pop('ecache', None) |
162 return session |
165 return session |