Commit 2d573a20 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

allow changing the job queue in WebappUpdate

parent 033ae7a2
......@@ -59,6 +59,10 @@ class UserWebappForm(forms.ModelForm):
tags = TagField(label_suffix='')
memory_limit_mb = forms.IntegerField(label="Memory limit", label_suffix='',
min_value=0)
job_queue = forms.ModelChoiceField(
queryset=JobQueue.objects.all().distinct().order_by("timeout"),
label='Default job queue',
label_suffix='')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
......@@ -79,7 +83,8 @@ class UserWebappForm(forms.ModelForm):
class Meta:
model = Webapp
fields = ('name', 'description', 'contact', 'notebook_gitrepo',
'private', 'owner', 'docker_os', 'tags', 'entrypoint')
'private', 'owner', 'docker_os', 'tags', 'entrypoint',
'job_queue')
class HomeSignupForm(SignupForm):
......
{% extends "base.html" %}
{% load i18n static htmlattrs %}
{% load i18n static htmlattrs converters %}
{% block title %}Update your webapp{% endblock %}
......@@ -67,6 +67,18 @@
{{ form.notebook_gitrepo.label_tag }}
{{ form.notebook_gitrepo | attr:"placeholder:https://example.tld/repo.git" | add_class:"form-control" }}
</div>
<div class="form-group">
{{ form.job_queue.label_tag }}
<select name="{{ form.job_queue.name }}" id="{{ form.job_queue.id_for_label }}" class="form-control">
{% for choice in form.job_queue.field.queryset %}
<option value="{{ choice.pk }}"
{% if choice.pk == form.instance.job_queue_id %} selected {% endif %}
>{{ choice | fancy_job_queue }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<div class="form-check">
......
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