#1071 don't commit till the git repos are created while making new project
Merged 7 years ago by pingou. Opened 7 years ago by vivekanand1101.
vivekanand1101/pagure flush  into  master

file modified
+4 -1
@@ -1011,7 +1011,7 @@ 

      )

      session.add(project)

      # Make sure we won't have SQLAlchemy error before we create the repo

-     session.commit()

+     session.flush()

  

      if not add_readme:

          pygit2.init_repository(gitrepo, bare=True)
@@ -1067,6 +1067,9 @@ 

          requestrepo, bare=True,

          mode=pygit2.C.GIT_REPOSITORY_INIT_SHARED_GROUP)

  

+     #create the project in the db

+     session.commit()

+ 

      pagure.lib.notify.log(

          project,

          topic='project.new',

no initial comment

the tests ran without any failures

Shouldn't we commit at the end?

don't we always do this in the next statements, whenever we call the func?

As it was done in this method, I'd rather be safe than sorry and keep it in as well :)

rebased

7 years ago

Cool :thumbsup: for me thanks :)

Pull-Request has been merged by pingou

7 years ago
Metadata