diff --git a/src/components/admin/components/ImportHolidays.py b/src/components/admin/components/ImportHolidays.py index 18a9b17..3b99151 100644 --- a/src/components/admin/components/ImportHolidays.py +++ b/src/components/admin/components/ImportHolidays.py @@ -10,7 +10,6 @@ from components.datagrid_new.settings import DataGridSettings from components.hoildays.helpers.nibelisparser import NibelisParser from components.repositories.constants import USERS_REPOSITORY_NAME, HOLIDAYS_TABLE_NAME from components_helpers import mk_dialog_buttons, set_boundaries -from conftest import session from core.instance_manager import InstanceManager diff --git a/src/components/hoildays/helpers/calendar_helper.py b/src/components/hoildays/helpers/calendar_helper.py index 78024c9..1d1b921 100644 --- a/src/components/hoildays/helpers/calendar_helper.py +++ b/src/components/hoildays/helpers/calendar_helper.py @@ -22,6 +22,9 @@ class CalendarHelper: # step two # create a dict [date, list[holiday]] according to the sorted list names + if len(records) == 0: + return [], {} + # step 1 temp = {} names = set() diff --git a/src/utils/Datahelper.py b/src/utils/Datahelper.py index 3cdcfa7..0e91f1d 100644 --- a/src/utils/Datahelper.py +++ b/src/utils/Datahelper.py @@ -10,6 +10,9 @@ class DataHelper: datagrid_db = DataGridDbManager(session, settings_manager, key) dataframe = datagrid_db.load_dataframe() + if dataframe is None: + return [] + if object_type: if is_dataclass(object_type): return [object_type(**row) for row in dataframe.to_dict(orient="records")]