bin/cubicweb-ctl
author |
Philippe Pepiot <philippe.pepiot@logilab.fr> |
|
Tue, 16 Apr 2019 15:49:03 +0200 |
branch | 3.26 |
changeset 12577 |
2508ba96fad2 |
parent 12253 |
9165f4b7426b
|
child 12779 |
44147dab9d27 |
permissions |
-rwxr-xr-x |
[devtools/testlib] avoid hidding AttributeError in create_user()
commit() might raise a AttributeError too.
Use getattr(req, 'cnx', req) instead, which is a form already used to get the real cnx
in some code:
cubicweb/rset.py:577: cnx = getattr(self.req, 'cnx', self.req)
cubicweb/schema.py:353: with getattr(_cw, 'cnx', _cw).security_enabled(read=False):
We could use if hasattr(req, 'commit') here too but it lead to 3 additionals lines.
Maybe we should have commit() and rollback() on
cubicweb.web.request.ConnectionCubicWebRequestBase too ?
0
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff
changeset
|
1 |
#!/usr/bin/env python
|
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff
changeset
|
2 |
from cubicweb.cwctl import run
|
12253
9165f4b7426b
Set a default value for arguments of cubicweb.cwctl:run()
Denis Laxalde <denis.laxalde@logilab.fr>
diff
changeset
|
3 |
run()
|