]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
sources: Return database row after creating commit
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Oct 2017 17:40:15 +0000 (18:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Oct 2017 17:40:15 +0000 (18:40 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/sources.py

index b65504b8c6c75b2297d517d6c5a764d0a75b93b0..fdadcff041ac45a92c290f9bb4667037a2d331e7 100644 (file)
@@ -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