Merge "Ignore bad requests in notification hook"
This commit is contained in:
commit
5b66484873
@ -68,6 +68,10 @@ class NotificationHook(hooks.PecanHook):
|
||||
if state.request.method not in ['POST', 'PUT', 'DELETE']:
|
||||
return
|
||||
|
||||
# Ignore requests that failed
|
||||
if state.response.status_code >= 400:
|
||||
return
|
||||
|
||||
request = state.request
|
||||
response = state.response
|
||||
|
||||
|
@ -256,7 +256,7 @@ class TestNotificationHook(base.BaseDbTestCase):
|
||||
mock_state.request.headers = {'Referer': 'http://localhost/'}
|
||||
mock_state.request.query_string = ''
|
||||
mock_state.request.path = '/v1/tasks/1'
|
||||
mock_state.response.status_code = '200'
|
||||
mock_state.response.status_code = 200
|
||||
mock_state.old_entity_values = sot_json
|
||||
mock_get_original_resource.return_value = smt_json
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user