diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-07-28 14:48:03 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-07-28 14:48:03 +0100 |
commit | 8c3b1c8c9550c9fec9a82a9afa1c4670fcf42e07 (patch) | |
tree | d6797742e580a555aca511ccc50dc757ab93bc38 /app/tasks/importtasks.py | |
parent | ecdb755dd3632a6c64c8d189b19255ba45e08cb7 (diff) | |
download | cheatdb-8c3b1c8c9550c9fec9a82a9afa1c4670fcf42e07.tar.xz |
Add commit hash to releases
Diffstat (limited to 'app/tasks/importtasks.py')
-rw-r--r-- | app/tasks/importtasks.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/tasks/importtasks.py b/app/tasks/importtasks.py index 18ce2e6..9afc8b6 100644 --- a/app/tasks/importtasks.py +++ b/app/tasks/importtasks.py @@ -344,9 +344,10 @@ def makeVCSReleaseFromGithub(id, branch, release, url): if len(commits) == 0 or not "sha" in commits[0]: raise TaskError("No commits found") - release.url = urlmaker.getCommitDownload(commits[0]["sha"]) + release.url = urlmaker.getCommitDownload(commits[0]["sha"]) + release.task_id = None + release.commit_hash = commits[0]["sha"] print(release.url) - release.task_id = None db.session.commit() return release.url @@ -374,9 +375,10 @@ def makeVCSRelease(id, branch): with open(destPath, "wb") as fp: repo.archive(fp, format="zip") - release.url = "/uploads/" + filename + release.url = "/uploads/" + filename + release.task_id = None + release.commit_hash = repo.head.object.hexsha print(release.url) - release.task_id = None db.session.commit() return release.url |