python3-commons 0.6.13__py3-none-any.whl → 0.6.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,15 +22,16 @@ async def _store_response_for_audit(
22
22
  ):
23
23
  response_text = await response.text()
24
24
 
25
- now = datetime.now(tz=UTC)
26
- date_path = now.strftime('%Y/%m/%d')
27
- timestamp = now.strftime('%H%M%S_%f')
25
+ if response_text:
26
+ now = datetime.now(tz=UTC)
27
+ date_path = now.strftime('%Y/%m/%d')
28
+ timestamp = now.strftime('%H%M%S_%f')
28
29
 
29
- await audit.write_audit_data(
30
- s3_settings,
31
- f'{date_path}/{audit_name}/{uri_path}/{method}_{timestamp}_{request_id}_response.txt',
32
- response_text.encode('utf-8')
33
- )
30
+ await audit.write_audit_data(
31
+ s3_settings,
32
+ f'{date_path}/{audit_name}/{uri_path}/{method}_{timestamp}_{request_id}_response.txt',
33
+ response_text.encode('utf-8')
34
+ )
34
35
 
35
36
 
36
37
  @asynccontextmanager
@@ -51,7 +52,7 @@ async def request(
51
52
  request_id = str(uuid4())[-12:]
52
53
  uri_path = uri[:-1] if uri.endswith('/') else uri
53
54
  uri_path = uri_path[1:] if uri_path.startswith('/') else uri_path
54
- url = f'{u[:-1] if (u := str(base_url).endswith('/')) else u}{uri}'
55
+ url = f'{u[:-1] if (u := str(base_url)).endswith('/') else u}{uri}'
55
56
 
56
57
  if audit_name:
57
58
  curl_request = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: python3-commons
3
- Version: 0.6.13
3
+ Version: 0.6.15
4
4
  Summary: Re-usable Python3 code
5
5
  Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
6
6
  License: gpl-3
@@ -1,5 +1,5 @@
1
1
  python3_commons/__init__.py,sha256=0KgaYU46H_IMKn-BuasoRN3C4Hi45KlkHHoPbU9cwiA,189
2
- python3_commons/api_client.py,sha256=fIkKY2Ihe5N-NGmVEEKOGAlpLfD8oLZcrp2Hc3akFRg,3561
2
+ python3_commons/api_client.py,sha256=D1GC7Lu5VH_qXET2DhSoEJM2wpRu-WcQVBTkqAE8tYY,3615
3
3
  python3_commons/audit.py,sha256=DMQ-nrWSs0qilD7wkz_8PV4jXcee75O8FgAm2YIuOiY,6256
4
4
  python3_commons/conf.py,sha256=qm2a2yWOhfawicBPjWnUett8TrsMtoyQXDxEJ_N-v-Y,637
5
5
  python3_commons/db.py,sha256=qhaDIdzBWgFyeP_XPKfHZlYVlwS2bpBPYMv84yV6820,738
@@ -13,9 +13,9 @@ python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
13
13
  python3_commons/serializers/json.py,sha256=P288wWz9ic38QWEMrpp_uwKPYkQiOgvE1cI4WZn6ZCg,808
14
14
  python3_commons/serializers/msgpack.py,sha256=tzIGGyDL3UpZnnouCtnxuYDx6InKM_C3PP1N4PN8wd4,1269
15
15
  python3_commons/serializers/msgspec.py,sha256=FuZVqOLJb0-lEKrs7dtjhwEbHIpfMUk5yu1hD64zRdc,2038
16
- python3_commons-0.6.13.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
17
- python3_commons-0.6.13.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
18
- python3_commons-0.6.13.dist-info/METADATA,sha256=FTWH-mqm4aVxonehi887B2gF64nt8PRtPumBHTJgNck,986
19
- python3_commons-0.6.13.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
- python3_commons-0.6.13.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
21
- python3_commons-0.6.13.dist-info/RECORD,,
16
+ python3_commons-0.6.15.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
17
+ python3_commons-0.6.15.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
18
+ python3_commons-0.6.15.dist-info/METADATA,sha256=VP09sgV1ZzT7VBet_P1WkOTrpHgr6R4-eYFdxy8TBI4,986
19
+ python3_commons-0.6.15.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
+ python3_commons-0.6.15.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
21
+ python3_commons-0.6.15.dist-info/RECORD,,