--- a/ztfy/utils/request.py Sat Dec 10 01:32:15 2011 +0100
+++ b/ztfy/utils/request.py Sat Dec 10 01:33:04 2011 +0100
@@ -28,6 +28,7 @@
# import local packages
from ztfy.utils import _
+from zope.security.interfaces import NoInteraction
def getRequest():
@@ -39,6 +40,13 @@
raise RuntimeError, _("No Request in interaction !")
+def queryRequest():
+ try:
+ return getRequest()
+ except NoInteraction:
+ return None
+
+
def getRequestPrincipal(request=None):
"""Get principal from given request"""
if request is None: