diff --git a/src/server/BreCal/database/sql_handler.py b/src/server/BreCal/database/sql_handler.py index c228e8c..f34f345 100644 --- a/src/server/BreCal/database/sql_handler.py +++ b/src/server/BreCal/database/sql_handler.py @@ -218,8 +218,6 @@ class SQLHandler(): def get_times_of_shipcall(self, shipcall)->pd.DataFrame: df_times = self.df_dict.get('times') # -> pd.DataFrame - if df_times is None: - return None df_times = df_times.loc[df_times["shipcall_id"]==shipcall.id] return df_times diff --git a/src/server/BreCal/validators/validation_rules.py b/src/server/BreCal/validators/validation_rules.py index 2753446..febbff4 100644 --- a/src/server/BreCal/validators/validation_rules.py +++ b/src/server/BreCal/validators/validation_rules.py @@ -31,6 +31,9 @@ class ValidationRules(ValidationRuleFunctions): # prepare df_times, which every validation rule tends to use df_times = self.sql_handler.df_dict.get('times') # -> pd.DataFrame + if len(df_times)==0: + return (StatusFlags.GREEN.value, []) + # filter by shipcall id df_times = self.sql_handler.get_times_of_shipcall(shipcall)