From: Tom Powell Date: Mon, 29 Oct 2018 03:11:54 +0000 (-0700) Subject: Include datetime from webhook X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c95384ecea90fd57a221081fa39b695030cad9e7;p=GitLab%2Fstricted-build%2Flineage_builder.git Include datetime from webhook --- diff --git a/ui/gitlab/webhooks.py b/ui/gitlab/webhooks.py index 13e3b3f..8e26ccd 100644 --- a/ui/gitlab/webhooks.py +++ b/ui/gitlab/webhooks.py @@ -1,3 +1,5 @@ +import datetime + from flask import abort from ui import config @@ -32,6 +34,8 @@ def process(request): build.build_runner = Runner.get_or_create_by_id(runner.get('id')) if not build.build_runner.runner_name: build.build_runner.runner_name = runner.get("description") + date = datetime.datetime.strptime(build_stage.get("created_at"), "%Y-%m-%d %H:%M:%S UTC") + build.build_date = date db.session.add(build) db.session.commit() if build.build_status in ['failed', 'canceled']: