Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Storing the user of the transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Jan 16, 2017
1 parent c13b6a8 commit a6a5ca2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plone.server/plone/server/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from zope.interface import implementer
from zope.proxy import ProxyBase
from zope.security.interfaces import Unauthorized
from plone.server.utils import get_authenticated_user_id

import asyncio
import inspect
Expand Down Expand Up @@ -44,10 +45,12 @@ def begin(self, request=None):
if request is None:
request = get_current_request()

user = get_authenticated_user_id(request)
txn = getattr(request, '_txn', None)
if txn is not None:
txn.abort()
txn = request._txn = transaction.Transaction(self._synchs, self)
txn.user = user
_new_transaction(txn, self._synchs)
request._txn_time = time.time()

Expand Down

0 comments on commit a6a5ca2

Please sign in to comment.