elody 0.0.170__py3-none-any.whl → 0.0.172__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.
elody/csv.py CHANGED
@@ -259,6 +259,8 @@ class CSVMultiObject(CSVParser):
259
259
  for key, value in row.items():
260
260
  if not value:
261
261
  continue
262
+ if key != identifying_column:
263
+ value = value.lower()
262
264
  if key == "file_source":
263
265
  file_source = value
264
266
  if (
@@ -295,14 +297,9 @@ class CSVMultiObject(CSVParser):
295
297
  ) and self.__field_allowed(type, key, value):
296
298
  metadata_info = self.metadata_field_mapping.get(key, {})
297
299
  if metadata_info.get("target") == type or not metadata_info:
298
- case_insensitive = metadata_info.get(
299
- "case_insensitive", False
300
- )
301
300
  metadata_key = metadata_info.get("map_to", key)
302
301
  indexed_dict[type][id].setdefault("metadata", list())
303
302
  options = metadata_info.get("value_options")
304
- if case_insensitive:
305
- value = value.lower()
306
303
  if options and value not in options:
307
304
  if "invalid_value" not in self.get_errors():
308
305
  self.set_error("invalid_value", list())
@@ -7,7 +7,7 @@ from elody.policies.permission_handler import (
7
7
  handle_single_item_request,
8
8
  mask_protected_content_post_request_hook,
9
9
  )
10
- from flask import Request # pyright: ignore
10
+ from flask import g, Request # pyright: ignore
11
11
  from inuits_policy_based_auth import BaseAuthorizationPolicy # pyright: ignore
12
12
  from inuits_policy_based_auth.contexts.policy_context import ( # pyright: ignore
13
13
  PolicyContext,
@@ -52,7 +52,8 @@ class PostRequestRules:
52
52
  if request.method != "POST":
53
53
  return None
54
54
 
55
- content = get_content(request.json, request, request.json)
55
+ content = g.get("content") or request.json
56
+ content = get_content(content, request, content)
56
57
  schema_type = get_object_configuration_mapper().get(content["type"]).SCHEMA_TYPE
57
58
  item = {**content, "schema": {"type": schema_type}}
58
59
  return handle_single_item_request(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: elody
3
- Version: 0.0.170
3
+ Version: 0.0.172
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,7 +1,7 @@
1
1
  __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  elody/__init__.py,sha256=d0Q6Fn44e7wFfLabDOBxpcJ1DPKWlFunGYDUBmO-4hA,22
3
3
  elody/client.py,sha256=VFjUUaE9edtK1XuAF5T3ayem2UEBr-Anww8AhITYLdI,8575
4
- elody/csv.py,sha256=_GrDLzx86QEKtXeC35fJtlYQzI3F4tnZWD6ZoLq7-1I,15679
4
+ elody/csv.py,sha256=5LZfr6p8eeK0IDHICfyBgKSMRCM-YXzXaomzl7G1-bc,15518
5
5
  elody/error_codes.py,sha256=7ZLY69YScCB0Ghxqf2LiCt-U_JCYA_T8jTMlIDlvv2s,4179
6
6
  elody/exceptions.py,sha256=5KSw2sPCZz3lDIJX4LiR2iL9n4m4KIil04D1d3X5rd0,968
7
7
  elody/job.py,sha256=QnN6Q45yqRimziqJX9SHrTVFVvky5mAc1WEza9ia8_w,2811
@@ -30,7 +30,7 @@ elody/policies/authorization/generic_object_mediafiles_policy.py,sha256=bo9OL13-
30
30
  elody/policies/authorization/generic_object_metadata_policy.py,sha256=K-tNO1QIrlACupFSiZ12gH-N7T0s3y2hpPIpiKC_maQ,2783
31
31
  elody/policies/authorization/generic_object_relations_policy.py,sha256=NRhywIntTpR69R_Lf1-sKfgWdXd7NW2K-lL8cGqWhhQ,3708
32
32
  elody/policies/authorization/generic_object_request_policy.py,sha256=H9VGCMLyXO1k4n6ZOHOKcQ6K5ofLjjKe9KVTHH2FPIY,4863
33
- elody/policies/authorization/generic_object_request_policy_v2.py,sha256=0bAjeq2uDunUDybOYApmNCpaaeCq97kNJEoqSfEUNMg,5051
33
+ elody/policies/authorization/generic_object_request_policy_v2.py,sha256=efVCkidyMuNnT5p2O4X5GsFWatXYxbQKqX4RKXV0kK4,5095
34
34
  elody/policies/authorization/mediafile_derivatives_policy.py,sha256=-i_JRgMcLjDQ85rzjBcrm3hXevAoTn5Z6itgt83K2Ik,3161
35
35
  elody/policies/authorization/mediafile_download_policy.py,sha256=q5yib9EmXaWUcRMr-Kg2Fob7M7Mte6C8cmJ7K-rj_Go,2531
36
36
  elody/policies/authorization/multi_tenant_policy.py,sha256=SA9H7SBjzuh8mY3gYN7pDG8TV7hdI3GEUtNeiZeNL3M,3164
@@ -40,8 +40,8 @@ tests/data.py,sha256=Q3oxduf-E3m-Z5G_p3fcs8jVy6g10I7zXKL1m94UVMI,2906
40
40
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  tests/unit/test_csv.py,sha256=NQaOhehfQ4GuXku0Y1SA8DYjJeqqidbF50zEHAi8RZA,15923
42
42
  tests/unit/test_utils.py,sha256=g63szcEZyHhCOtrW4BnNbcgVca3oYPIOLjBdIzNwwN0,8784
43
- elody-0.0.170.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
44
- elody-0.0.170.dist-info/METADATA,sha256=lIBFmbQXiX6EPy4s-2n50n2i3W3K7P6Gh7dCSC4Z-Yo,23336
45
- elody-0.0.170.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
46
- elody-0.0.170.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
- elody-0.0.170.dist-info/RECORD,,
43
+ elody-0.0.172.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
44
+ elody-0.0.172.dist-info/METADATA,sha256=4oHyHnRZ4-xmyBKazXMZuxT5G0XzYZMSgX6axwhhgXE,23336
45
+ elody-0.0.172.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
46
+ elody-0.0.172.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
+ elody-0.0.172.dist-info/RECORD,,