translate_property_mappings: old_id not in checkin_list_map

This commit is contained in:
Mira Weller
2025-07-17 13:53:21 +02:00
parent 08a66e5e0b
commit 22b011594a

View File

@@ -520,7 +520,12 @@ def translate_property_mappings(property_mappings, checkin_list_map):
for mapping in mappings:
if mapping["pretix_field"].startswith("checkin_date_"):
old_id = int(mapping["pretix_field"][len("checkin_date_"):])
mapping["pretix_field"] = "checkin_date_%d" % checkin_list_map[old_id].pk
if old_id not in checkin_list_map:
# old_id might not be in checkin_list_map, because copying of an event series only copies check-in
# lists covering the whole series, not individual dates.
mapping["pretix_field"] = "_invalid_" + mapping["pretix_field"]
else:
mapping["pretix_field"] = "checkin_date_%d" % checkin_list_map[old_id].pk
return json.dumps(mappings)