# HG changeset patch # User Julien Cristau # Date 1396361570 -7200 # Node ID 29450466273a46c4c60adce935d16ecf5425a0fc # Parent e7d38148799e8a3f1cb62e15cc2fd459b802dc4a [server] eschema_eid needs a connection, not a session diff -r e7d38148799e -r 29450466273a server/utils.py --- a/server/utils.py Tue Apr 01 15:53:21 2014 +0200 +++ b/server/utils.py Tue Apr 01 16:12:50 2014 +0200 @@ -73,13 +73,13 @@ return '' -def eschema_eid(session, eschema): +def eschema_eid(cnx, eschema): """get eid of the CWEType entity for the given yams type. You should use this because when schema has been loaded from the file-system, not from the database, (e.g. during tests), eschema.eid is not set. """ if eschema.eid is None: - eschema.eid = session.execute( + eschema.eid = cnx.execute( 'Any X WHERE X is CWEType, X name %(name)s', {'name': str(eschema)})[0][0] return eschema.eid