From 1dbd38dc4ab701f10e8f7b490372394e985ca2fe Mon Sep 17 00:00:00 2001 From: Oliver Zander Date: Mon, 20 Oct 2025 14:40:25 +0200 Subject: [PATCH] remove other option before saving --- input/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/input/models.py b/input/models.py index 45f38e9..5193d7f 100755 --- a/input/models.py +++ b/input/models.py @@ -203,6 +203,14 @@ class ProjectCategoryField(models.ManyToManyField): return super().formfield(**kwargs) + def save_form_data(self, instance, data): + data = list(data) + + with suppress(ValueError): + data.remove(self.remote_field.model.other) + + return super().save_form_data(instance, data) + class Project(Volunteer): end_mail_send = models.BooleanField(default=False, verbose_name='Keine Projektabschlussmail schicken')