File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 66
77import requests
88from cuenca_validations .errors import ERROR_CODES
9+ from cuenca_validations .types import JSONEncoder
910from cuenca_validations .typing import (
1011 ClientRequestParams ,
1112 DictStrAny ,
@@ -110,21 +111,11 @@ def request(
110111 self .jwt_token = Jwt .create (self )
111112 self .session .headers ['X-Cuenca-Token' ] = self .jwt_token .token
112113
113- if data is not None :
114- for key , value in data .items ():
115- if isinstance (value , dt .date ):
116- data [key ] = value .isoformat ()
117- elif isinstance (value , list ):
118- for elem in value :
119- for k , v in elem .items ():
120- if isinstance (v , dt .date ):
121- elem [k ] = v .isoformat ()
122-
123114 resp = self .session .request (
124115 method = method ,
125116 url = 'https://' + self .host + urljoin ('/' , endpoint ),
126117 auth = self .auth ,
127- json = data ,
118+ json = json . dumps ( data , cls = JSONEncoder ) ,
128119 params = params ,
129120 ** kwargs ,
130121 )
Original file line number Diff line number Diff line change 11requests == 2.27.1
2- cuenca-validations == 0.10.20.dev2
2+ cuenca-validations == 0.10.20.dev3
33dataclasses >= 0.7 ;python_version < "3.7"
You can’t perform that action at this time.
0 commit comments