Restore context in deny() page
authorSverre Rabbelier <srabbelier@gmail.com>
Fri, 23 Jan 2009 16:54:46 +0000 (2009-01-23)
changeset 927 f790f77ba6b7
parent 926 390c8a98cdd0
child 928 df051fc9d7a1
Restore context in deny() page Now that we know when the sidebar is doing the access checks we can safely construct a new context in deny (without having to worry that it will try to do more access checks that result in deny, which will call for a new context... etc). Patch by: Sverre Rabbelier
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Fri Jan 23 16:53:19 2009 +0000
+++ b/app/soc/views/helper/access.py	Fri Jan 23 16:54:46 2009 +0000
@@ -126,7 +126,14 @@
   Raises:
     always raises AccessViolationResponse if called
   """
-  context = {}
+
+  import soc.views.helper.responses
+
+  if kwargs.get('SIDEBAR_CALLING', False):
+    context = {}
+  else:
+    context = soc.views.helper.responses.getUniversalContext(request)
+
   context['title'] = 'Access denied'
 
   raise out_of_band.AccessViolation(DEF_PAGE_DENIED_MSG, context=context)