--- a/src/pyams_utils/request.py Sat Mar 14 13:49:03 2015 +0100
+++ b/src/pyams_utils/request.py Sat Mar 14 13:49:25 2015 +0100
@@ -16,8 +16,8 @@
# import standard library
# import interfaces
+from pyams_utils.interfaces import MissingRequestError
from zope.annotation.interfaces import IAttributeAnnotatable, IAnnotations
-from zope.security.interfaces import NoInteraction
# import packages
from pyramid.request import Request
@@ -31,7 +31,7 @@
Raises a NoInteraction exception if there is no active request"""
request = get_current_request()
if (request is None) and raise_exception:
- raise NoInteraction("No request")
+ raise MissingRequestError("No request")
return request
@@ -41,7 +41,7 @@
Returns None if there is no active request"""
try:
return get_request()
- except NoInteraction:
+ except MissingRequestError:
return None
@@ -49,7 +49,7 @@
"""Get current request, or create a new blank one if missing"""
try:
return get_request()
- except NoInteraction:
+ except MissingRequestError:
return Request.blank(path, environ, base_url, headers, POST, **kw)