From 8cc2eb3f2155f7cbc88b9be57b9617d567ec61ca Mon Sep 17 00:00:00 2001
From: Philip ABBET <philip.abbet@idiap.ch>
Date: Tue, 20 Dec 2016 11:43:47 +0100
Subject: [PATCH] [install] Ensure that an environment supporting Python is
 used by default for the installed example experiments

---
 beat/web/utils/management/commands/install.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 beat/web/utils/management/commands/install.py

diff --git a/beat/web/utils/management/commands/install.py b/beat/web/utils/management/commands/install.py
old mode 100644
new mode 100755
index 8e8cba72e..e5f753cfa
--- a/beat/web/utils/management/commands/install.py
+++ b/beat/web/utils/management/commands/install.py
@@ -1043,9 +1043,10 @@ class Command(BaseCommand):
         # Sets up the queue and environments
         setup_environment(arguments['queue_configuration'],
             arguments['verbosity'])
-        from ....backend.models import Environment, Queue
-        environment = Environment.objects.first()
-        queue = Queue.objects.first()
+        from ....backend.models import Environment, EnvironmentLanguage, Queue
+        from ....code.models import Code
+        environment = EnvironmentLanguage.objects.filter(language=Code.PYTHON).first().environment
+        queue = environment.queues.first()
 
         # Iterates over projects to install
         for project in ['system'] + arguments['project']:
-- 
GitLab