diff -r 9b4de34ad394 -r 97095348b3ee cubicweb/server/utils.py --- a/cubicweb/server/utils.py Thu Feb 11 21:59:49 2016 +0100 +++ b/cubicweb/server/utils.py Wed Feb 17 13:45:34 2016 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -31,6 +31,8 @@ from passlib.utils import handlers as uh, to_hash_str from passlib.context import CryptContext +from logilab.common.deprecation import deprecated + from cubicweb.md5crypt import crypt as md5crypt @@ -76,16 +78,14 @@ # wrong password return b'' - +@deprecated('[3.22] no more necessary, directly get eschema.eid') 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. + """get eid of the CWEType entity for the given yams type. + + This used to be necessary because when the schema has been loaded from the + file-system, not from the database, (e.g. during tests), eschema.eid was + not set. """ - if eschema.eid is None: - eschema.eid = cnx.execute( - 'Any X WHERE X is CWEType, X name %(name)s', - {'name': text_type(eschema)})[0][0] return eschema.eid