mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 10:08:36 +02:00
feat(import): move required field check to end of process
This commit is contained in:
@@ -406,15 +406,15 @@ class ImportService:
|
|||||||
if value is None:
|
if value is None:
|
||||||
value = mapping.default
|
value = mapping.default
|
||||||
|
|
||||||
if mapping.required and value is None and not mapping.transformations:
|
|
||||||
raise ValueError(f"Required field {field} is missing")
|
|
||||||
|
|
||||||
# Apply transformations
|
# Apply transformations
|
||||||
if mapping.transformations:
|
if mapping.transformations:
|
||||||
value = self._transform_value(value, mapping, row)
|
value = self._transform_value(value, mapping, row)
|
||||||
|
|
||||||
value = self._coerce_type(value, mapping)
|
value = self._coerce_type(value, mapping)
|
||||||
|
|
||||||
|
if mapping.required and value is None:
|
||||||
|
raise ValueError(f"Required field {field} is missing")
|
||||||
|
|
||||||
if value is not None:
|
if value is not None:
|
||||||
# Remove the prefix from the target field
|
# Remove the prefix from the target field
|
||||||
target = mapping.target
|
target = mapping.target
|
||||||
|
|||||||
Reference in New Issue
Block a user