changeset 5863:5f5faedac588

remove copy.copy() that crashed on windows/iis/isapi-wsgi after page save, replace it with minimal FakeRequest instance
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 03 Jun 2012 01:59:03 +0200
parents 5b92be3da023
children aaf543f558d9
files MoinMoin/search/builtin.py
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/builtin.py	Sun May 27 20:21:32 2012 +0200
+++ b/MoinMoin/search/builtin.py	Sun Jun 03 01:59:03 2012 +0200
@@ -270,18 +270,22 @@
 
         @param request: current request
         """
-        import copy
         from MoinMoin.security import Permissions
-        from MoinMoin.logfile import editlog
+        from MoinMoin.user import User
 
         class SecurityPolicy(Permissions):
-
             def read(self, *args, **kw):
                 return True
 
-        r = copy.copy(request)
+        class FakeRequest(object):
+            """ minimal request object for indexing code """
+
+        r = FakeRequest()
+        r.cfg = request.cfg
+        r.page = request.page
+        r.rootpage = request.rootpage
+        r.user = User(request)
         r.user.may = SecurityPolicy(r.user)
-        r.editlog = editlog.EditLog(r)
         return r