From 8dd48def3dc0cd18b695d0f9ec6c610b9f5c335c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 02 2015 16:45:56 +0000 Subject: Commit early in the new_project method of the internal library This we avoid creating the git repos if we cannot create the project in the database --- diff --git a/progit/lib/__init__.py b/progit/lib/__init__.py index 9739754..598ee03 100644 --- a/progit/lib/__init__.py +++ b/progit/lib/__init__.py @@ -365,7 +365,7 @@ def new_project(session, user, name, gitfolder, docfolder, ticketfolder, ) session.add(project) # Make sure we won't have SQLAlchemy error before we create the repo - session.flush() + session.commit() pygit2.init_repository(gitrepo, bare=True)