diff --git a/RIGS/forms.py b/RIGS/forms.py index c5e5de66..17ba4acd 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -190,6 +190,8 @@ class EventRiskAssessmentForm(forms.ModelForm): class EventChecklistForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + if self.instance.event.venue: + self.fields['venue'].initial = self.instance.event.venue self.fields['date'].widget.format = '%Y-%m-%d' for name, field in self.fields.items(): if field.__class__ == forms.NullBooleanField: @@ -211,6 +213,10 @@ class EventChecklistForm(forms.ModelForm): class PowerTestRecordForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + if self.instance.event.venue: + self.fields['venue'].initial = self.instance.event.venue + if self.instance.event.riskassessment.power_mic: + self.fields['power_mic'].initial = self.instance.event.riskassessment.power_mic for name, field in self.fields.items(): if field.__class__ == forms.NullBooleanField: # Only display yes/no to user, the 'none' is only ever set in the background diff --git a/RIGS/templates/hs/event_checklist_form.html b/RIGS/templates/hs/event_checklist_form.html index ea8183a1..373ad306 100644 --- a/RIGS/templates/hs/event_checklist_form.html +++ b/RIGS/templates/hs/event_checklist_form.html @@ -24,7 +24,7 @@ {% block content %}