[cwconfig] Do not override user-defined CW_MODE in virtualenv setup 3.23
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 16 Aug 2016 14:16:10 +0200
branch3.23
changeset 11444 e1876845fa10
parent 11433 a703f00718c2
child 11445 b2eb66dfd9c6
[cwconfig] Do not override user-defined CW_MODE in virtualenv setup And thus consider `_forced_mode` first. Related to #14789440.
cubicweb/cwconfig.py
--- a/cubicweb/cwconfig.py	Wed Jul 06 20:28:51 2016 +0200
+++ b/cubicweb/cwconfig.py	Tue Aug 16 14:16:10 2016 +0200
@@ -357,8 +357,8 @@
     quick_start = False
 
     if 'VIRTUAL_ENV' in os.environ:
+        mode = _forced_mode or 'user'
         _CUBES_DIR = join(_INSTALL_PREFIX, 'share', 'cubicweb', 'cubes')
-        mode = 'user'
     elif CWDEV and _forced_mode != 'system':
         mode = 'user'
         _CUBES_DIR = join(CW_SOFTWARE_ROOT, '../../cubes')