File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ def create(self, entity):
110110 e .response .status_code ,
111111 error_message ))
112112 raise e
113- entity .id = int ( frost_sta_client .utils .extract_value (response .headers ['location' ]) )
113+ entity .id = frost_sta_client .utils .extract_value (response .headers ['location' ])
114114 entity .service = self .service
115115 logging .debug ('Received response: ' + str (response .status_code ))
116116
Original file line number Diff line number Diff line change 2323
2424
2525def extract_value (location ):
26- return location [location .find ('(' )+ 1 : location .find (')' )]
27-
26+ try :
27+ value = int (location [location .find ('(' )+ 1 : location .find (')' )])
28+ except ValueError :
29+ value = str (location [location .find ('(' )+ 2 : location .find (')' )- 1 ])
30+ return value
2831
2932def transform_entity_to_json_dict (entity ):
3033 json_str = jsonpickle .encode (entity , unpicklable = False )
You can’t perform that action at this time.
0 commit comments