From f00961caea1f2aaae4e841275758206cf63c3af5 Mon Sep 17 00:00:00 2001 From: Well Date: Tue, 9 Jan 2024 21:24:18 +0800 Subject: [PATCH 1/2] * fix unit --- directory/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/directory/models.py b/directory/models.py index aa73e1146d..bf175cf546 100644 --- a/directory/models.py +++ b/directory/models.py @@ -1023,7 +1023,7 @@ def as_json(fraction) -> dict: result = { "pk": fraction.pk, "title": fraction.title, - "unit": fraction.unit, + "unit": fraction.unit.title if fraction.unit else '', "variants": fraction.variants.get_variants(), "order": fraction.sort_weight, "ecpCode": fraction.ecp_id, From bea67895d9e21375a2366cd77d5f86521fd3d555 Mon Sep 17 00:00:00 2001 From: Well Date: Tue, 9 Jan 2024 21:24:55 +0800 Subject: [PATCH 2/2] * fix variants --- directory/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/directory/models.py b/directory/models.py index bf175cf546..7e24a520af 100644 --- a/directory/models.py +++ b/directory/models.py @@ -1024,7 +1024,7 @@ def as_json(fraction) -> dict: "pk": fraction.pk, "title": fraction.title, "unit": fraction.unit.title if fraction.unit else '', - "variants": fraction.variants.get_variants(), + "variants": fraction.variants.get_variants() if fraction.variants else '', "order": fraction.sort_weight, "ecpCode": fraction.ecp_id, "fsli": fraction.fsli,