commit 4e3912795262f6f2ac24d93cf2cd3ac8f3c46ed2
parent 89be8f3589fded2e32f36b2c69777200fa28ce1a
Author: bain <bain@bain.cz>
Date: Sun, 28 Aug 2022 01:14:24 +0200
bug fix
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/toggl2sheets.py b/toggl2sheets.py
@@ -109,7 +109,15 @@ def get_toggl_entries(
f'Toggl responded with non-200 status code: {resp}, body: "{resp.text}"'
)
entries = resp.json()
- last_entry = next(filter(lambda x: x["duration"] > 0, entries), None)
+ last_entry = next(
+ filter(
+ lambda x: x["duration"] > 0
+ and entry["server_deleted_at"] is None
+ and entry["project_id"] in projects,
+ entries,
+ ),
+ None,
+ )
# construct a dict of d["project name"] = [[date, description, duration (hours), wage], ...]
out = defaultdict(list)