Skip to content
Snippets Groups Projects
Commit f508e43a authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

AKSubmission: Use event default slot length as default when adding new slot for AK

parent 505a6050
No related branches found
No related tags found
1 merge request!80AKSubmission: Use event default slot length as default when adding new slot for AK
Pipeline #9288 passed
...@@ -162,6 +162,13 @@ class AKDurationForm(forms.ModelForm): ...@@ -162,6 +162,13 @@ class AKDurationForm(forms.ModelForm):
'event': forms.HiddenInput 'event': forms.HiddenInput
} }
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.initial = {**self.initial, **kwargs['initial']}
event = self.initial.get('event')
if event is not None:
self.initial['duration'] = event.default_slot
class AKOrgaMessageForm(forms.ModelForm): class AKOrgaMessageForm(forms.ModelForm):
class Meta: class Meta:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment