From b5e851313975814b7b3375b3e83c78ae3d567dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=A4ttasch?= <benjamin.haettasch@fachschaft.informatik.tu-darmstadt.de> Date: Tue, 25 Mar 2025 14:49:16 +0100 Subject: [PATCH] AKSubmission: Preselect types in new submissions --- AKSubmission/forms.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AKSubmission/forms.py b/AKSubmission/forms.py index 70913ae7..3bb19ee5 100644 --- a/AKSubmission/forms.py +++ b/AKSubmission/forms.py @@ -152,6 +152,9 @@ class AKSubmissionForm(AKForm): class Meta(AKForm.Meta): # Exclude fields again that were previously included in the parent class exclude = ['link', 'protocol_link'] #pylint: disable=modelform-uses-exclude + widgets = AKForm.Meta.widgets | { + 'types': forms.CheckboxSelectMultiple(attrs={'checked' : 'checked'}), + } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -188,6 +191,9 @@ class AKWishForm(AKForm): class Meta(AKForm.Meta): # Exclude fields again that were previously included in the parent class exclude = ['owners', 'link', 'protocol_link'] #pylint: disable=modelform-uses-exclude + widgets = AKForm.Meta.widgets | { + 'types': forms.CheckboxSelectMultiple(attrs={'checked': 'checked'}), + } class AKOwnerForm(forms.ModelForm): -- GitLab