From f9d000b953dc41ff6987413d4bd3776b2ca1f3a6 Mon Sep 17 00:00:00 2001 From: Benbb96 Date: Sat, 16 Jan 2021 23:28:30 +0100 Subject: [PATCH] Fix #926 --- helpdesk/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpdesk/forms.py b/helpdesk/forms.py index d6779c69..92594fca 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -98,6 +98,9 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm): try: current_value = TicketCustomFieldValue.objects.get(ticket=self.instance, field=field) initial_value = current_value.value + # If it is boolean field, transform the value to a real boolean instead of a string + if current_value.field.data_type == 'boolean': + initial_value = initial_value == 'True' except TicketCustomFieldValue.DoesNotExist: initial_value = None instanceargs = {