changeset 4256:c9483e402491

Wrap request only if it's not already a Context-object
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 31 Jul 2008 15:59:57 +0200
parents 9d1817e8140b
children 29e81e73fe67
files MoinMoin/wsgiapp.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wsgiapp.py	Thu Jul 31 15:58:31 2008 +0200
+++ b/MoinMoin/wsgiapp.py	Thu Jul 31 15:59:57 2008 +0200
@@ -25,7 +25,10 @@
     Wraps an incoming WSGI request in a Context object and initializes
     several important attributes.
     """
-    context = AllContext(request)
+    if isinstance(request, Context):
+        context, request = request, request.request
+    else:
+        context = AllContext(request)
     context.clock.start('total')
     context.clock.start('init')