From 86d8598eacfafc580238fefe54216a331a323670 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 17 Oct 2017 18:40:15 +0100 Subject: [PATCH] sources: Return database row after creating commit Signed-off-by: Michael Tremer --- src/buildservice/sources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buildservice/sources.py b/src/buildservice/sources.py index b65504b..fdadcff 100644 --- a/src/buildservice/sources.py +++ b/src/buildservice/sources.py @@ -280,8 +280,8 @@ class Source(base.DataObject): def create_commit(self, revision, author, committer, subject, body, date): commit = self.backend.sources._get_commit("INSERT INTO sources_commits(source_id, \ - revision, author, committer, subject, body, date) VALUES(%s, %s, %s, %s, %s, %s, %s)", - self.id, revision, author, committer, subject, body, date) + revision, author, committer, subject, body, date) VALUES(%s, %s, %s, %s, %s, %s, %s) \ + RETURNING *", self.id, revision, author, committer, subject, body, date) # Commit commit.source = self -- 2.47.3