parse timestamp from commit
This commit is contained in:
parent
8d30a66478
commit
b525c2b508
|
@ -4,6 +4,7 @@ from buildbot.util import bytes2unicode
|
||||||
from buildbot.www.hooks.base import BaseHookHandler
|
from buildbot.www.hooks.base import BaseHookHandler
|
||||||
|
|
||||||
from twisted.python import log
|
from twisted.python import log
|
||||||
|
from dateutil.parser import parse as dateparse
|
||||||
|
|
||||||
_HEADER_EVENT_TYPE = 'X-Gitea-Event'
|
_HEADER_EVENT_TYPE = 'X-Gitea-Event'
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ class GiteaHandler(BaseHookHandler):
|
||||||
project = repository["full_name"]
|
project = repository["full_name"]
|
||||||
|
|
||||||
for commit in payload["commits"]:
|
for commit in payload["commits"]:
|
||||||
timestamp = commit["timestamp"]
|
timestamp = dateparse(commit["timestamp"])
|
||||||
change = {
|
change = {
|
||||||
'author': '%s <%s>'.format((commit['author']['name'],
|
'author': '%s <%s>'.format((commit['author']['name'],
|
||||||
commit['author']['email'])),
|
commit['author']['email'])),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user