diff options
Diffstat (limited to 'gitsrht/blueprints')
-rw-r--r-- | gitsrht/blueprints/repo.py | 2 | ||||
-rw-r--r-- | gitsrht/blueprints/stats.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 028c8d6..8bfd374 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -83,6 +83,8 @@ def summary(owner, repo): tags = [(ref, git_repo.get(git_repo.references[ref].target)) for ref in git_repo.listall_references() if ref.startswith("refs/tags/")] + tags = [tag for tag in tags + if isinstance(tag[1], pygit2.Tag) or isinstance(tag[1], pygit2.Commit)] tags = sorted(tags, key=lambda c: commit_time(c[1]), reverse=True) latest_tag = tags[0] if len(tags) else None return render_template("summary.html", view="summary", diff --git a/gitsrht/blueprints/stats.py b/gitsrht/blueprints/stats.py index 82c562b..57a9f3e 100644 --- a/gitsrht/blueprints/stats.py +++ b/gitsrht/blueprints/stats.py @@ -32,7 +32,10 @@ def get_contributions(git_repo, tip, since): if timestamp < since_ts: break - week = _week(datetime.fromtimestamp(timestamp)) + try: + week = _week(datetime.fromtimestamp(timestamp)) + except: + continue user = _user(commit.author.email, commit.author.name) contributions[user]['commits'] += 1 contributions[user]['weekly'][week] += 1 |