Commit 46f65300 authored by Samuel GAIST's avatar Samuel GAIST

[utils][commands][install] Improve query to get an environment

The current one gets the first environment found
for the python language rather than getting an
active environment for that language.
parent cce36b66
Pipeline #47844 passed with stage
in 17 minutes and 20 seconds
......@@ -1317,12 +1317,12 @@ class Command(BaseCommand):
else:
system_user, plot_user, user = get_users(arguments["username"])
from ....backend.models import EnvironmentLanguage
from ....backend.models import Environment
from ....code.models import Code
environment = (
EnvironmentLanguage.objects.filter(language=Code.PYTHON).first().environment
)
environment = Environment.objects.filter(
languages__language=Code.PYTHON, active=True
).first()
queue = environment.queues.first()
# Iterates over projects to install
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment