Commit 7b4ed528 authored by Valentin Benozillo's avatar Valentin Benozillo

product: Add TimeoutReachedError to restricted python

parent 15e46bc7
......@@ -32,6 +32,8 @@ from AccessControl.SecurityInfo import ModuleSecurityInfo
from ZPublisher.HTTPResponse import status_codes
from Products.TimerService.timerserver.TimerServer import TimerRequest
module_security = ModuleSecurityInfo(__name__)
__all__ = (
'TimeoutReachedError', 'Deadline', 'getDeadline', 'getTimeLeft',
'getPublisherDeadlineValue',
......@@ -43,6 +45,8 @@ class TimeoutReachedError(Exception):
"""
pass
module_security.declarePublic('TimeoutReachedError')
# There is no appropriate status code for timeout.
status_codes['timeoutreachederror'] = 500 # Internal Server Error
del status_codes
......@@ -85,7 +89,7 @@ def Deadline(offset):
finally:
_site_local.deadline = old_deadline
ModuleSecurityInfo('Products.ERP5Type.Timeout').declarePublic('Deadline')
module_security.declarePublic('Deadline')
def getDeadline():
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment