diff --git a/directory/models.py b/directory/models.py index aa73e1146d..7e24a520af 100644 --- a/directory/models.py +++ b/directory/models.py @@ -1023,8 +1023,8 @@ def as_json(fraction) -> dict: result = { "pk": fraction.pk, "title": fraction.title, - "unit": fraction.unit, - "variants": fraction.variants.get_variants(), + "unit": fraction.unit.title if fraction.unit else '', + "variants": fraction.variants.get_variants() if fraction.variants else '', "order": fraction.sort_weight, "ecpCode": fraction.ecp_id, "fsli": fraction.fsli,