From 9346920a97a9954c0893e015c751fec87900f8b6 Mon Sep 17 00:00:00 2001 From: scopesorting Date: Tue, 21 Nov 2023 11:51:49 +0100 Subject: [PATCH] potentially solving the 'shipcall_id' error log --- src/server/BreCal/database/sql_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/BreCal/database/sql_handler.py b/src/server/BreCal/database/sql_handler.py index f715b4b..f34f345 100644 --- a/src/server/BreCal/database/sql_handler.py +++ b/src/server/BreCal/database/sql_handler.py @@ -207,7 +207,8 @@ class SQLHandler(): returns: participant_id_list, where every element is an int """ df = self.df_dict.get("shipcall_participant_map") - df = df.set_index('shipcall_id', inplace=False) + if 'shipcall_id' in list(df.columns): + df = df.set_index('shipcall_id', inplace=False) # the 'if' call is needed to ensure, that no Exception is raised, when the shipcall_id is not present in the df participant_id_list = df.loc[shipcall_id, "participant_id"].tolist() if shipcall_id in list(df.index) else []