fixing the 'KeyError' when using an empty times dataframe. Returning 'green'

This commit is contained in:
scopesorting 2023-11-28 14:17:07 +01:00 committed by puls200
parent 6ce6e882e9
commit 836c1aa802

View File

@ -39,6 +39,9 @@ class ValidationRules(ValidationRuleFunctions):
if len(spm.loc[spm["shipcall_id"]==shipcall.id])==0:
return (StatusFlags.GREEN.value, [])
if len(df_times)==0:
return (StatusFlags.GREEN.value, [])
# filter by shipcall id
df_times = self.sql_handler.get_times_of_shipcall(shipcall)