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

product: Add TimeoutReachedError to restricted python

parent 15e46bc7
Pipeline #27602 failed with stage
...@@ -32,6 +32,8 @@ from AccessControl.SecurityInfo import ModuleSecurityInfo ...@@ -32,6 +32,8 @@ from AccessControl.SecurityInfo import ModuleSecurityInfo
from ZPublisher.HTTPResponse import status_codes from ZPublisher.HTTPResponse import status_codes
from Products.TimerService.timerserver.TimerServer import TimerRequest from Products.TimerService.timerserver.TimerServer import TimerRequest
module_security = ModuleSecurityInfo(__name__)
__all__ = ( __all__ = (
'TimeoutReachedError', 'Deadline', 'getDeadline', 'getTimeLeft', 'TimeoutReachedError', 'Deadline', 'getDeadline', 'getTimeLeft',
'getPublisherDeadlineValue', 'getPublisherDeadlineValue',
...@@ -43,6 +45,8 @@ class TimeoutReachedError(Exception): ...@@ -43,6 +45,8 @@ class TimeoutReachedError(Exception):
""" """
pass pass
module_security.declarePublic('TimeoutReachedError')
# There is no appropriate status code for timeout. # There is no appropriate status code for timeout.
status_codes['timeoutreachederror'] = 500 # Internal Server Error status_codes['timeoutreachederror'] = 500 # Internal Server Error
del status_codes del status_codes
...@@ -85,7 +89,7 @@ def Deadline(offset): ...@@ -85,7 +89,7 @@ def Deadline(offset):
finally: finally:
_site_local.deadline = old_deadline _site_local.deadline = old_deadline
ModuleSecurityInfo('Products.ERP5Type.Timeout').declarePublic('Deadline') module_security.declarePublic('Deadline')
def getDeadline(): 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