From b525c2b508713a32ccf0d6a9a1896778e1583582 Mon Sep 17 00:00:00 2001 From: Marvin Pohl Date: Tue, 4 Sep 2018 12:58:05 +0200 Subject: [PATCH] parse timestamp from commit --- gitea/webhook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitea/webhook.py b/gitea/webhook.py index 2bb7d18..d7e0704 100644 --- a/gitea/webhook.py +++ b/gitea/webhook.py @@ -4,6 +4,7 @@ from buildbot.util import bytes2unicode from buildbot.www.hooks.base import BaseHookHandler from twisted.python import log +from dateutil.parser import parse as dateparse _HEADER_EVENT_TYPE = 'X-Gitea-Event' @@ -28,7 +29,7 @@ class GiteaHandler(BaseHookHandler): project = repository["full_name"] for commit in payload["commits"]: - timestamp = commit["timestamp"] + timestamp = dateparse(commit["timestamp"]) change = { 'author': '%s <%s>'.format((commit['author']['name'], commit['author']['email'])),