diff --git a/app/models.py b/app/models.py
index 0452009f..281867c6 100644
--- a/app/models.py
+++ b/app/models.py
@@ -591,6 +591,7 @@ class PackageRelease(db.Model):
url = db.Column(db.String(200), nullable=False)
approved = db.Column(db.Boolean, nullable=False, default=False)
task_id = db.Column(db.String(37), nullable=True)
+ commit_hash = db.Column(db.String(41), nullable=True, default=None)
def getEditURL(self):
diff --git a/app/tasks/importtasks.py b/app/tasks/importtasks.py
index 18ce2e6a..9afc8b69 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
diff --git a/app/templates/packages/release_edit.html b/app/templates/packages/release_edit.html
index a201a38b..faa475eb 100644
--- a/app/templates/packages/release_edit.html
+++ b/app/templates/packages/release_edit.html
@@ -21,6 +21,10 @@
Url: {{ release.url }}
{% endif %}
+ {% if release.commit_hash %}
+ Commit Hash: {{ release.commit_hash }}
+ {% endif %}
+
{% if release.task_id %}
Importing... view task
{% if package.checkPerm(current_user, "CHANGE_RELEASE_URL") %}
diff --git a/app/templates/packages/view.html b/app/templates/packages/view.html
index b118046e..181ae998 100644
--- a/app/templates/packages/view.html
+++ b/app/templates/packages/view.html
@@ -188,7 +188,8 @@