web/application.py
changeset 10740 59e89db3a67d
parent 10604 d4bf85db41f2
child 10744 c5dc40988e6e
--- a/web/application.py	Wed Sep 30 18:03:53 2015 +0200
+++ b/web/application.py	Wed Sep 30 18:04:27 2015 +0200
@@ -25,6 +25,7 @@
 from warnings import warn
 import json
 
+from six import text_type
 from six.moves import http_client
 
 from logilab.common.deprecation import deprecated
@@ -80,8 +81,8 @@
 
     def reset_session_manager(self):
         data = self.session_manager.dump_data()
-        self.session_manager = self.vreg['components'].select('sessionmanager',
-                                                              repo=self.repo)
+        self.session_manager = self.vreg['sessions'].select('sessionmanager',
+                                                            repo=self.repo)
         self.session_manager.restore_data(data)
         global SESSION_MANAGER
         SESSION_MANAGER = self.session_manager
@@ -497,7 +498,7 @@
         if req.status_out < 400:
             # don't overwrite it if it's already set
             req.status_out = status
-        json_dumper = getattr(ex, 'dumps', lambda : json.dumps({'reason': unicode(ex)}))
+        json_dumper = getattr(ex, 'dumps', lambda : json.dumps({'reason': text_type(ex)}))
         return json_dumper()
 
     # special case handling