From ff83dda9287aa82c842dda0bb88ce389ff5bd9cc Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 24 May 2018 19:15:13 +0100 Subject: [PATCH] Fix crash on new release due to None id --- app/views/packages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/packages.py b/app/views/packages.py index b28ecfcb..ced8c356 100644 --- a/app/views/packages.py +++ b/app/views/packages.py @@ -426,6 +426,7 @@ def create_release_page(package): rel.title = form["title"].data rel.url = "" rel.task_id = uuid() + db.session.add(rel) db.session.commit() makeVCSRelease.apply_async((rel.id, form["vcsLabel"].data), task_id=rel.task_id) @@ -443,6 +444,7 @@ def create_release_page(package): rel.title = form["title"].data rel.url = uploadedPath db.session.add(rel) + db.session.commit() msg = "{}: Release {} created".format(package.title, rel.title) triggerNotif(package.author, current_user, msg, rel.getEditURL())