Skip to content

Commit

Permalink
Fixed type error when exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Wohnsland committed Aug 31, 2020
1 parent 8b2d7fe commit 0495b12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/button_controler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, database_controler, ui_element):
self.config_handler = ConfigHandler()
self.data_exporter = DataExporter()
self.updater = Updater()
self.report_df = []
self.report_df = pd.DataFrame([])
self.daily_data = []
self.no_data = True
self.past_time = False
Expand Down Expand Up @@ -79,7 +79,7 @@ def on_date_change(self):
if not work_data:
self.no_data = True
# self.ui_controler.show_message("No data here, nothing to do here ...")
self.report_df = []
self.report_df = pd.DataFrame([])
return
self.no_data = False
work_df = self.create_work_df(work_data)
Expand Down Expand Up @@ -168,7 +168,7 @@ def export_data(self):
return
succesful, message = self.data_exporter.export_data(self.report_df, report_date, overtime_report)
if succesful:
self.ui_controler.show_message(f"File saved under: {file_path}")
self.ui_controler.show_message(f"File saved under: {message}")
else:
self.ui_controler.show_message(message)

Expand Down
2 changes: 1 addition & 1 deletion src/data_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):
self.worktime = 8

def export_data(self, df, report_date, overtime_report=True):
if not df:
if df.empty:
message = f"No data to export, will no generate file..."
print(message)
return False, message
Expand Down

0 comments on commit 0495b12

Please sign in to comment.