From 269bb6039cd40425b99ec4e1b9de278353e41480 Mon Sep 17 00:00:00 2001
From: Carlos Vega <carlos.vega@uni.lu>
Date: Mon, 16 Nov 2020 10:50:18 +0100
Subject: [PATCH] replaced str_to_yes_no for str_to_yes_no_null

---
 smash/web/api_views/subject.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/smash/web/api_views/subject.py b/smash/web/api_views/subject.py
index 687ca3d2..7e3ce4e7 100644
--- a/smash/web/api_views/subject.py
+++ b/smash/web/api_views/subject.py
@@ -7,7 +7,7 @@ from django.db.models import Q
 from django.http import JsonResponse
 from django.urls import reverse
 
-from web.api_views.serialization_utils import bool_to_yes_no, flying_team_to_str, location_to_str, add_column, \
+from web.api_views.serialization_utils import str_to_yes_no_null, bool_to_yes_no, flying_team_to_str, location_to_str, add_column, \
     serialize_date, serialize_datetime, get_filters_for_data_table_request, virus_test_to_str, str_to_yes_no
 from web.models import ConfigurationItem, StudySubject, Visit, Appointment, Subject, SubjectColumns, StudyColumns, \
     Study, ContactAttempt
@@ -636,7 +636,7 @@ def serialize_subject(study_subject):
                 val = ''
             result[get_study_subject_field_id(field_value.study_subject_field)] = val
         elif field_value.study_subject_field.type == CUSTOM_FIELD_TYPE_BOOLEAN:
-            result[get_study_subject_field_id(field_value.study_subject_field)] = str_to_yes_no(field_value.value)
+            result[get_study_subject_field_id(field_value.study_subject_field)] = str_to_yes_no_null(field_value.value)
         elif field_value.study_subject_field.type == CUSTOM_FIELD_TYPE_DATE:
             result[get_study_subject_field_id(field_value.study_subject_field)] = field_value.value
         elif field_value.study_subject_field.type == CUSTOM_FIELD_TYPE_SELECT_LIST:
-- 
GitLab