summaryrefslogtreecommitdiff
path: root/releng
diff options
context:
space:
mode:
Diffstat (limited to 'releng')
-rw-r--r--releng/views.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/releng/views.py b/releng/views.py
index 973cf330..f23869f7 100644
--- a/releng/views.py
+++ b/releng/views.py
@@ -8,9 +8,10 @@ from .models import (Architecture, BootType, Bootloader, ClockChoice,
Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source,
Test)
-def standard_field(model, help_text=None):
+def standard_field(model, help_text=None, required=True):
return forms.ModelChoiceField(queryset=model.objects.all(),
- widget=forms.RadioSelect(), empty_label=None, help_text=help_text)
+ widget=forms.RadioSelect(), empty_label=None, help_text=help_text,
+ required=required)
class TestForm(forms.ModelForm):
iso = forms.ModelChoiceField(queryset=Iso.objects.filter(active=True))
@@ -26,10 +27,10 @@ class TestForm(forms.ModelForm):
modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(),
help_text="", widget=forms.CheckboxSelectMultiple(), required=False)
bootloader = standard_field(Bootloader)
- rollback_filesystem = forms.ModelChoiceField(queryset=Filesystem.objects.all(),
+ rollback_filesystem = standard_field(Filesystem,
help_text="If you did a rollback followed by a new attempt to setup " \
"your lockdevices/filesystems, select which option you took here.",
- widget=forms.RadioSelect(), required=False)
+ required=False)
rollback_modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(),
help_text="If you did a rollback followed b a new attempt to setup " \
"your lockdevices/filesystems, select which option you took here.",