This commit is contained in:
2026-01-20 15:36:55 +01:00
parent fcf61605d6
commit b43ab082b4

View File

@@ -101,6 +101,7 @@ class AutomationCron(ModelSQL, ModelView):
if existing: if existing:
parties_cache[name_upper] = existing[0] parties_cache[name_upper] = existing[0]
return existing[0] return existing[0]
if name:
new_p = Party() new_p = Party()
new_p.name = name_upper new_p.name = name_upper
parties_cache[name_upper] = new_p parties_cache[name_upper] = new_p
@@ -115,6 +116,7 @@ class AutomationCron(ModelSQL, ModelView):
if existing: if existing:
vessels_cache[name_upper] = existing[0] vessels_cache[name_upper] = existing[0]
return existing[0] return existing[0]
if name:
new_v = Vessel() new_v = Vessel()
new_v.vessel_name = name_upper new_v.vessel_name = name_upper
new_v.vessel_imo = imo new_v.vessel_imo = imo
@@ -130,6 +132,7 @@ class AutomationCron(ModelSQL, ModelView):
if existing: if existing:
locations_cache[key] = existing[0] locations_cache[key] = existing[0]
return existing[0] return existing[0]
if name:
new_loc = Location() new_loc = Location()
new_loc.name = name.upper() new_loc.name = name.upper()
new_loc.type = type_ new_loc.type = type_