Ejemplo n.º 1
0
    def process_response(self, request, response):
        """Closes the revision."""
        if (hasattr(request, 'user') and request.user is not None
                and request.user.is_authenticated()
                and revision_context_manager.is_active()):
            revision_context_manager.set_user(request.user)

        if revision_context_manager.is_active():
            revision_context_manager.set_comment(
                'Request log from "RevisionMiddleware", path "%s"' %
                request.path)

        self._close_revision(request)
        return response
Ejemplo n.º 2
0
    def process_response(self, request, response):
        """Closes the revision."""
        if (
            hasattr(request, "user")
            and request.user is not None
            and request.user.is_authenticated()
            and revision_context_manager.is_active()
        ):
            revision_context_manager.set_user(request.user)

        if revision_context_manager.is_active():
            revision_context_manager.set_comment('Request log from "RevisionMiddleware", path "%s"' % request.path)

        self._close_revision(request)
        return response
Ejemplo n.º 3
0
 def process_response(self, request, response):
     """Closes the revision."""
     # look to see if the session has been accessed before looking for user to stop Vary: Cookie
     if hasattr(request, 'session') and request.session.accessed \
             and hasattr(request, "user") and request.user.is_authenticated() \
             and revision_context_manager.is_active():
         revision_context_manager.set_user(request.user)
     self._close_revision(request)
     return response
Ejemplo n.º 4
0
 def process_response(self, request, response):
     """Closes the revision."""
     # look to see if the session has been accessed before looking for user to stop Vary: Cookie
     if hasattr(request, 'session') and request.session.accessed \
             and hasattr(request, "user") and request.user.is_authenticated() \
             and revision_context_manager.is_active():
         revision_context_manager.set_user(request.user)
     self._close_revision(request)
     return response