Skip to content

Commit

Permalink
fix: Use fresh import_skel when importing multiple entries (#45)
Browse files Browse the repository at this point in the history
Caused an import_skel with presets being cleared entirely. This fixes it
now, and always gets a fresh import skel for every entry.
  • Loading branch information
phorward authored Jan 21, 2025
1 parent 5fd7a14 commit 3ff85ca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/viur/toolkit/importer/importable.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,8 @@ def do_import(
self._kickoff_follow(importdate, inform, import_conf_name=import_conf_name, **kwargs)
return None

# Get skeleton
# Get skeleton (used for config creation and examination)
skel = self.import_skel(skelType=kwargs.get("skelType"))

self.create_config(skel)

# Perform import
Expand All @@ -345,7 +344,7 @@ def do_import(

if self._convert_entry(
imp,
skel,
self.import_skel(skelType=kwargs.get("skelType")), # Get a fresh import skel
values,
importdate,
skel_type=kwargs.get("skelType"),
Expand Down Expand Up @@ -570,7 +569,6 @@ def _convert_entry(
"""
Internal function for converting one entry.
"""
skel.setEntity(db.Entity())
ret = imp.values_to_skel(
skel,
values,
Expand Down

0 comments on commit 3ff85ca

Please sign in to comment.