web/request.py
changeset 8696 0bb18407c053
parent 8695 358d8bed9626
child 8732 0d9c8f5eb285
--- a/web/request.py	Thu Feb 14 15:38:25 2013 +0100
+++ b/web/request.py	Thu Feb 14 16:01:24 2013 +0100
@@ -459,7 +459,7 @@
 
     def clear_user_callbacks(self):
         if self.session is not None: # XXX
-            for key in self.session.data.keys():
+            for key in list(self.session.data):
                 if key.startswith('cb_'):
                     del self.session.data[key]
 
@@ -753,8 +753,7 @@
     def from_controller(self):
         """return the id (string) of the controller issuing the request"""
         controller = self.relative_path(False).split('/', 1)[0]
-        registered_controllers = self.vreg['controllers'].keys()
-        if controller in registered_controllers:
+        if controller in self.vreg['controllers']:
             return controller
         return 'view'