skip entries not from selected workspace
This commit is contained in:
parent
e0eea41214
commit
89be8f3589
1 changed files with 7 additions and 2 deletions
|
@ -114,12 +114,17 @@ def get_toggl_entries(
|
|||
# construct a dict of d["project name"] = [[date, description, duration (hours), wage], ...]
|
||||
out = defaultdict(list)
|
||||
for entry in reversed(entries):
|
||||
if entry["duration"] <= 0 or entry["server_deleted_at"] is not None:
|
||||
continue # running entries and deleted entries
|
||||
if (
|
||||
entry["duration"] <= 0 # running entry
|
||||
or entry["server_deleted_at"] is not None # deleted entry
|
||||
or entry["project_id"] not in projects # entry not from selected workspace
|
||||
):
|
||||
continue
|
||||
start = datetime.datetime.fromisoformat(entry["start"].replace("Z", "+00:00"))
|
||||
end = datetime.datetime.fromisoformat(entry["stop"].replace("Z", "+00:00"))
|
||||
if end <= last_edit:
|
||||
continue # get better accuracy than toggl lets us in their requests
|
||||
|
||||
out[projects[entry["project_id"]]].append(
|
||||
[
|
||||
start.astimezone().strftime("%-d. %-m. %Y"),
|
||||
|
|
Loading…
Reference in a new issue