mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-18 22:12:14 +00:00
Do not use Django 'required' for radio selects
As this requires them to be True, whereas we just need to require that an option be entered.
This commit is contained in:
@@ -163,10 +163,9 @@ class EventRiskAssessmentForm(forms.ModelForm):
|
||||
field.widget = forms.RadioSelect(choices=[
|
||||
(True, 'Yes'),
|
||||
(False, 'No')
|
||||
], attrs={'class': 'custom-control-input'})
|
||||
field.required = True
|
||||
], attrs={'class': 'custom-control-input', 'required': 'true'})
|
||||
|
||||
class Meta:
|
||||
model = models.RiskAssessment
|
||||
fields = '__all__'
|
||||
exclude = ['event']
|
||||
exclude = []
|
||||
|
||||
Reference in New Issue
Block a user