elody 0.0.218__py3-none-any.whl → 0.0.220__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.
@@ -18,6 +18,7 @@ class BaseObjectConfiguration(ABC):
18
18
  overwrite=overwrite,
19
19
  **kwargs,
20
20
  ),
21
+ "document_exception_message_constructor": lambda exception, fallback_message: fallback_message,
21
22
  "nested_matcher_builder": lambda object_lists, keys_info, value, **kwargs: self.__build_nested_matcher(
22
23
  object_lists, keys_info, value, **kwargs
23
24
  ),
@@ -88,7 +88,15 @@ class ElodyConfiguration(BaseObjectConfiguration):
88
88
  else:
89
89
  document = {**template, **document_defaults}
90
90
  document = self._pre_crud_hook(
91
- crud="create", timestamp=timestamp, document=document
91
+ crud="create",
92
+ timestamp=timestamp,
93
+ document=document,
94
+ audit_override={
95
+ "date_created": document_defaults.get("date_created"),
96
+ "created_by": document_defaults.get("created_by"),
97
+ "date_updated": document_defaults.get("date_updated"),
98
+ "last_editor": document_defaults.get("last_editor"),
99
+ },
92
100
  )
93
101
  return document
94
102
 
@@ -129,10 +137,14 @@ class ElodyConfiguration(BaseObjectConfiguration):
129
137
  def _post_crud_hook(self, **kwargs):
130
138
  pass
131
139
 
132
- def _pre_crud_hook(self, *, crud, timestamp, document={}, **kwargs):
140
+ def _pre_crud_hook(
141
+ self, *, crud, timestamp, document={}, audit_override={}, **kwargs
142
+ ):
133
143
  if document:
134
144
  document = self.__patch_document_unique_value(document)
135
- document = self.__patch_document_audit_info(crud, document, timestamp)
145
+ document = self.__patch_document_audit_info(
146
+ crud, document, timestamp, audit_override
147
+ )
136
148
  document = self._sanitize_document(
137
149
  document=document,
138
150
  object_list_name="metadata",
@@ -164,11 +176,12 @@ class ElodyConfiguration(BaseObjectConfiguration):
164
176
  del element[key]
165
177
  return sanitized_document
166
178
 
167
- def __patch_document_audit_info(self, crud, document, timestamp):
179
+ def __patch_document_audit_info(self, crud, document, timestamp, audit_override):
168
180
  document.update({f"date_{crud}d": timestamp})
169
181
  if email := self._get_user_context_id():
170
182
  label = f"{crud}d_by" if crud == "create" else "last_editor"
171
183
  document.update({label: email})
184
+ document.update({key: value for key, value in audit_override.items() if value})
172
185
  return document
173
186
 
174
187
  def __patch_document_unique_value(self, document):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elody
3
- Version: 0.0.218
3
+ Version: 0.0.220
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -12,8 +12,8 @@ elody/validator.py,sha256=G7Ya538EJHCFzOxEri2OcFMabfLBCtTKxuf4os_KuNw,260
12
12
  elody/migration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  elody/migration/base_object_migrator.py,sha256=n8uvgGfjEUy60G47RD7Y-oxp1vHLOauwPMDl87LcxtU,436
14
14
  elody/object_configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- elody/object_configurations/base_object_configuration.py,sha256=NZG_QVS6JbPCWKbz7eYJlOTuNl2gh5QVRLwy6s9iiik,7465
16
- elody/object_configurations/elody_configuration.py,sha256=pktiS14jeZja-G6677Hse5zzeUpH5rHRzy7YK-H2wNU,10519
15
+ elody/object_configurations/base_object_configuration.py,sha256=AqOE0hCbXQDOdKFnDa9dbi-A-GRTUAaBZUe6_g0-Dc0,7573
16
+ elody/object_configurations/elody_configuration.py,sha256=T_gyQykQWC1wdGTwQ9DujmumG8uqgQlH0vbZKmxtpfw,11049
17
17
  elody/object_configurations/job_configuration.py,sha256=-dGhXGfCewLEcPLjkBiSgwUa1dPty6OMm8b0IOUOUgo,1507
18
18
  elody/object_configurations/saved_search_configuration.py,sha256=ddOry4EqYOeEKRF7q2M_fHoqZv8DXpQjFq8VaZ7jhVI,732
19
19
  elody/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -35,13 +35,13 @@ elody/policies/authorization/mediafile_derivatives_policy.py,sha256=OwNpbS8i7-Lz
35
35
  elody/policies/authorization/mediafile_download_policy.py,sha256=XMsKavBucmTh4W1kWOzpFWxJ_ZXgHVK1RS7JB4HjtQo,1979
36
36
  elody/policies/authorization/multi_tenant_policy.py,sha256=SA9H7SBjzuh8mY3gYN7pDG8TV7hdI3GEUtNeiZeNL3M,3164
37
37
  elody/policies/authorization/tenant_request_policy.py,sha256=dEgblwRAqwWVcE-O7Jn8hVL3OnwDlQhDEOcPlcElBrk,1185
38
- elody-0.0.218.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
38
+ elody-0.0.220.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
39
39
  tests/__init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  tests/data.py,sha256=Q3oxduf-E3m-Z5G_p3fcs8jVy6g10I7zXKL1m94UVMI,2906
41
41
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  tests/unit/test_csv.py,sha256=NQaOhehfQ4GuXku0Y1SA8DYjJeqqidbF50zEHAi8RZA,15923
43
43
  tests/unit/test_utils.py,sha256=g63szcEZyHhCOtrW4BnNbcgVca3oYPIOLjBdIzNwwN0,8784
44
- elody-0.0.218.dist-info/METADATA,sha256=_qRvbItyoDuVmDt4m9ihlw-h3TpYWZ2tb_Yv2VzRQwM,23358
45
- elody-0.0.218.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- elody-0.0.218.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
- elody-0.0.218.dist-info/RECORD,,
44
+ elody-0.0.220.dist-info/METADATA,sha256=LQldo9-kZVg9Pv6vWVM-zx0O7jQl5sGO-BQ6Wpj_LPE,23358
45
+ elody-0.0.220.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
+ elody-0.0.220.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
+ elody-0.0.220.dist-info/RECORD,,