fix smart-punch multiple punch-in if not punching for the current day

master
Maximilian Zettler 4 years ago
parent 158c436f32
commit b232edc082
  1. 6
      timebot/timebot.py

@ -293,7 +293,11 @@ class TimeBot:
self.mobatime_api.save_entry(punch_datetime, BREAK_END_ENTRY_CODE_ID, note="pause ende").raise_for_status()
def smart_punch(self, punch_datetime):
last_punch = self.mobatime_api.get_entries(1, punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0))
last_punch = self.mobatime_api.get_entries(
1,
start_date=punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0),
end_date=punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0),
)
method = None
if not last_punch or last_punch[0]["entryNumber"] is None:
self.logger.debug("could not detect any time entry for today... punching in")

Loading…
Cancel
Save