mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-26 19:31:19 +01: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:
|
||||
value = mapping.default
|
||||
|
||||
if mapping.required and value is None and not mapping.transformations:
|
||||
raise ValueError(f"Required field {field} is missing")
|
||||
|
||||
# Apply transformations
|
||||
if mapping.transformations:
|
||||
value = self._transform_value(value, mapping, row)
|
||||
|
||||
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:
|
||||
# Remove the prefix from the target field
|
||||
target = mapping.target
|
||||
|
||||
Reference in New Issue
Block a user