@@ -28,18 +28,23 @@ def _create_hook(self, return_response_only=False, **kwargs):
2828 self ._add_submissions ()
2929
3030 url = reverse ('hook-list' , args = (self .asset .uid ,))
31+
3132 data = {
3233 'name' : kwargs .get ('name' , 'some external service with token' ),
3334 'endpoint' : kwargs .get ('endpoint' , 'http://external.service.local/' ),
34- 'settings' : kwargs .get (
35- 'settings' , {'custom_headers' : {'X-Token' : '1234abcd' }}
36- ),
37- 'export_type' : format_type ,
38- 'active' : kwargs .get ('active' , True ),
39- 'subset_fields' : kwargs .get ('subset_fields' , []),
40- 'payload_template' : kwargs .get ('payload_template' , None ),
4135 }
4236
37+ if not kwargs .get ('minimal' , False ):
38+ data .update ({
39+ 'settings' : kwargs .get (
40+ 'settings' , {'custom_headers' : {'X-Token' : '1234abcd' }}
41+ ),
42+ 'active' : kwargs .get ('active' , True ),
43+ 'export_type' : format_type ,
44+ 'subset_fields' : kwargs .get ('subset_fields' , []),
45+ 'payload_template' : kwargs .get ('payload_template' , None ),
46+ })
47+
4348 response = self .client .post (url , data , format = 'json' )
4449 if return_response_only :
4550 return response
0 commit comments