From a17b6ce828c3bd1580989a73588a3f83458e4223 Mon Sep 17 00:00:00 2001 From: Maximilian Zettler Date: Mon, 24 Jan 2022 09:52:13 +0100 Subject: [PATCH] fix smart-punch if there is a missing booking for the selected day --- timebot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timebot.py b/timebot.py index f3318fb..78d1e3c 100644 --- a/timebot.py +++ b/timebot.py @@ -273,7 +273,7 @@ class TimeBot: def smart_punch(self, punch_datetime): last_punch = tb.mobatime_api.get_entries(1, punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0)) method = None - if not last_punch: + if not last_punch or last_punch[0]["entryNumber"] is None: logger.debug("could not detect any time entry for today... punching in") method = "punch_in" elif last_punch[0]["entryNumber"] == COMING_ENTRY_CODE_ID: