mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-23 17:04:26 +01:00
feat(import): move required field check to end of process
This commit is contained in:
1 parent
d0172b5524
commit
928ad33111
1 file changed
+3
-3
@@ -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