Skip to content

Commit

Permalink
fix(import): insert_import_data_in_transient_table
Browse files Browse the repository at this point in the history
  • Loading branch information
20cents committed Nov 22, 2024
1 parent 68e327d commit 0866279
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/geonature/core/imports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,21 +293,22 @@ def build_fieldmapping(

for field in fields:
if field.name_field in imprt.fieldmapping:
column_src = imprt.fieldmapping[field.name_field].get("column_src", None)
if field.multi:
correct = list(set(columns) & set(imprt.fieldmapping[field.name_field]))
correct = list(set(columns) & set(column_src))
if len(correct) > 0:
fieldmapping[field.source_column] = {
"value": correct,
"field": field,
}
used_columns.extend(correct)
else:
if imprt.fieldmapping[field.name_field] in columns:
if column_src in columns:
fieldmapping[field.source_column] = {
"value": imprt.fieldmapping[field.name_field],
"value": column_src,
"field": field,
}
used_columns.append(imprt.fieldmapping[field.name_field])
used_columns.append(column_src)
return fieldmapping, used_columns


Expand Down

0 comments on commit 0866279

Please sign in to comment.