#4160 [dev-data] fix create_session and create_engine
Closed 5 years ago by pingou. Opened 5 years ago by rom1dep.
rom1dep/pagure dev-data  into  master

file modified
+2 -1
@@ -21,6 +21,7 @@ 

  import pagure.lib.query

  from pagure.lib.login import generate_hashed_value

  from pagure.lib.model import create_default_status

+ from pagure.lib.query import create_session

  from pagure.lib.repo import PagureRepo

  

  
@@ -45,7 +46,7 @@ 

          acls=_config.get('ACLS', {}),

          debug=True)

  

-     engine = pagure.lib.query.create_engine('%s' % DB_URL, echo=True)

+     engine = create_engine('%s' % DB_URL, echo=True)

  

      metadata = MetaData(engine)

      metadata.reflect(bind=engine)

no initial comment

We're importing from pagure.lib.query import create_session and calling create_engine ?

I'm also not sure what this fixes, if we were calling the wrong method, it looks like we still are and otherwise, I'm not quite sure I see what we're fixing. I'm pretty sure the old syntax is valid.

Ok, reading https://pagure.io/pagure/pull-request/4152 I see where I was wrong.

I'm going to merge #4152 as it was opened first and I prefer its logic.

Thanks for your PR though and thanks for taking the time to look into this :)

Pull-Request has been closed by pingou

5 years ago