--- a/app/soc/modules/core.py Sat Aug 29 14:31:26 2009 -0700
+++ b/app/soc/modules/core.py Sat Aug 29 14:32:14 2009 -0700
@@ -111,6 +111,7 @@
self.sitemap = []
self.sidebar = []
self.per_request_cache = {}
+ self.in_request = False
##
## internal
@@ -142,6 +143,7 @@
"""Prepares core to handle a new request.
"""
+ self.in_request = True
self.per_request_value = {}
self.setRequestValue('request', request)
@@ -151,6 +153,7 @@
old_request = self.getRequestValue('request')
self.per_request_value = {}
+ self.in_request = False
if id(old_request) != id(request):
logging.error("ending request: \n'%s'\n != \n'%s'\n" % (
@@ -160,12 +163,14 @@
"""Gets a per-request value.
"""
+ assert self.in_request
return self.per_request_value.get(key, default)
def setRequestValue(self, key, value):
"""Sets a per-request value.
"""
+ assert self.in_request
self.per_request_value[key] = value
def getPatterns(self):