Hotfix for NoneType kid ages

This commit is contained in:
Jonas Linter
2025-11-13 11:39:57 +01:00
parent e161508a61
commit 189e44a7ff

View File

@@ -611,7 +611,7 @@ async def process_wix_form_submission(request: Request, data: dict[str, Any], db
)
# Room/guest info
num_adults = int(data.get("field:number_7cf5") or 2)
num_adults = int(data.get("field:number_7cf5") or 1)
num_children = int(data.get("field:anzahl_kinder") or 0)
children_ages = []
if num_children > 0:
@@ -620,6 +620,8 @@ async def process_wix_form_submission(request: Request, data: dict[str, Any], db
temp_ages = []
for k in data:
if k.startswith("field:alter_kind_"):
if data[k] is None or data[k] == "":
continue
try:
age = int(data[k])
temp_ages.append(age)