Skip to content

Commit 74b2df2

Browse files
committed
FIxes
1 parent a93985c commit 74b2df2

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

tracklater/timemodules/gitmodule.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ def get_entries(self) -> List[Entry]:
5252

5353
class Provider(AbstractProvider):
5454
def get_log_entries(self, repo_path, start_date=None):
55-
repo = git.Repo(repo_path)
55+
try:
56+
repo = git.Repo(repo_path)
57+
except Exception:
58+
return
5659
for head in repo.heads:
5760
iterator = repo.iter_commits(head)
5861
for commit in iterator:

tracklater/timemodules/toggl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_entries(self) -> List[Entry]:
5252

5353
def get_projects(self) -> List[Project]:
5454
clients = self.provider.request('me/clients', method='GET')
55-
projects = self.provider.request('me/projects', method='GET')
55+
new_projects = self.provider.request('me/projects', method='GET')
5656
projects = []
5757
toggl_settings = cast(Any, settings.TOGGL)
5858
for client in clients:
@@ -62,7 +62,7 @@ def get_projects(self) -> List[Project]:
6262
groups.append(project)
6363
if not groups:
6464
continue
65-
for project in projects:
65+
for project in new_projects:
6666
for group in groups:
6767
if project['name'] in toggl_settings[group]['PROJECTS']:
6868
break
@@ -73,6 +73,8 @@ def get_projects(self) -> List[Project]:
7373
title="{} - {}".format(client['name'], project['name']),
7474
group=group
7575
))
76+
logger.warning("Found project: %s - %s", project['id'], project['name'])
77+
7678
return projects
7779

7880
def create_entry(self, new_entry: Entry, issue: Optional[Issue]) -> Entry:

0 commit comments

Comments
 (0)