From abb3ae1502ea66d93d1d12487b195a6c6b8de35b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 29 Apr 2011 09:33:30 -0500 Subject: releng: make rollback fs a standard_option Signed-off-by: Dan McGee --- releng/views.py | 9 +++++---- 1 file 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 @@ 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.", -- cgit v1.2.3-54-g00ecf