elody 0.0.166__tar.gz → 0.0.167__tar.gz
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-0.0.166 → elody-0.0.167}/PKG-INFO +1 -1
- {elody-0.0.166 → elody-0.0.167}/pyproject.toml +1 -1
- {elody-0.0.166 → elody-0.0.167}/src/elody/csv.py +9 -3
- {elody-0.0.166 → elody-0.0.167}/src/elody/error_codes.py +2 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody.egg-info/PKG-INFO +1 -1
- {elody-0.0.166 → elody-0.0.167}/LICENSE +0 -0
- {elody-0.0.166 → elody-0.0.167}/README.md +0 -0
- {elody-0.0.166 → elody-0.0.167}/setup.cfg +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/client.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/exceptions.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/job.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/loader.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/migration/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/migration/base_object_migrator.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/object_configurations/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/object_configurations/base_object_configuration.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/object_configurations/elody_configuration.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/object_configurations/job_configuration.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authentication/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_detail_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/helpers.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/permission_handler.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/policies/tenant_id_resolver.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/schemas.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/util.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody/validator.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody.egg-info/SOURCES.txt +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody.egg-info/dependency_links.txt +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody.egg-info/requires.txt +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/elody.egg-info/top_level.txt +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/tests/__init_.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/tests/data.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/tests/unit/__init__.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/tests/unit/test_csv.py +0 -0
- {elody-0.0.166 → elody-0.0.167}/src/tests/unit/test_utils.py +0 -0
|
@@ -2,6 +2,7 @@ import csv
|
|
|
2
2
|
import re
|
|
3
3
|
|
|
4
4
|
from io import StringIO
|
|
5
|
+
from elody.error_codes import ErrorCode, get_error_code, get_write
|
|
5
6
|
from elody.exceptions import (
|
|
6
7
|
ColumnNotFoundException,
|
|
7
8
|
IncorrectTypeException,
|
|
@@ -160,6 +161,9 @@ class CSVMultiObject(CSVParser):
|
|
|
160
161
|
def get_errors(self):
|
|
161
162
|
return self.errors
|
|
162
163
|
|
|
164
|
+
def set_error(self, type, errors):
|
|
165
|
+
self.errors[type] = errors
|
|
166
|
+
|
|
163
167
|
def get_top_level_fields_mapping(self, type):
|
|
164
168
|
return self.top_level_fields_mapping.get(type, {})
|
|
165
169
|
|
|
@@ -262,9 +266,11 @@ class CSVMultiObject(CSVParser):
|
|
|
262
266
|
if case_insensitive:
|
|
263
267
|
value = value.lower()
|
|
264
268
|
if options and value not in options:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
)
|
|
269
|
+
if "invalid_value" not in self.get_errors():
|
|
270
|
+
self.set_error("invalid_value", list())
|
|
271
|
+
message = f'{get_error_code(ErrorCode.INVALID_VALUE, get_write())} | value:{value} | options:{options} - The value "{value}" is invalid, these are the valid values: {options}'
|
|
272
|
+
self.get_errors()["invalid_value"].append(message)
|
|
273
|
+
|
|
268
274
|
indexed_dict[type][id]["metadata"].append(
|
|
269
275
|
self._get_metadata_object(metadata_key, value, lang)
|
|
270
276
|
)
|
|
@@ -71,6 +71,8 @@ class ErrorCode(Enum):
|
|
|
71
71
|
INVALID_FORMAT_FOR_TYPE = ("5013", ["type"])
|
|
72
72
|
NO_METADATA_AVAILABLE_FOR_ITEM = ("5014", ["id"])
|
|
73
73
|
INVALID_ACCEPT_HEADER = ("5015", [])
|
|
74
|
+
INVALID_VALUE = ("5016", ["value", "options"])
|
|
75
|
+
ITEM_WITH_VALUE_FOR_KEY_NOT_FOUND = ("5017", ["key", "value"])
|
|
74
76
|
|
|
75
77
|
# Filter error codes
|
|
76
78
|
NO_MATCHER_FOR_FILTER_REQUEST = ("6001", [])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/object_configurations/base_object_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/filter_generic_objects_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_detail_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_mediafiles_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_metadata_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_relations_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_request_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/generic_object_request_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/mediafile_derivatives_policy.py
RENAMED
|
File without changes
|
{elody-0.0.166 → elody-0.0.167}/src/elody/policies/authorization/mediafile_download_policy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|