fix smart-punch if there is a missing booking for the selected day

master
Maximilian Zettler 4 years ago
parent 695741f0bc
commit a17b6ce828
  1. 2
      timebot.py

@ -273,7 +273,7 @@ class TimeBot:
def smart_punch(self, punch_datetime): 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)) last_punch = tb.mobatime_api.get_entries(1, punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0))
method = None 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") logger.debug("could not detect any time entry for today... punching in")
method = "punch_in" method = "punch_in"
elif last_punch[0]["entryNumber"] == COMING_ENTRY_CODE_ID: elif last_punch[0]["entryNumber"] == COMING_ENTRY_CODE_ID:

Loading…
Cancel
Save