From d28c6c1310c52ebe601852e303999733c9808fb6 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 8 Feb 2023 14:32:59 +0000 Subject: [PATCH] Only add location and scheme fields to the export if the location and scheme exists --- app/services/exports/lettings_log_export_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/exports/lettings_log_export_service.rb b/app/services/exports/lettings_log_export_service.rb index 1819670b8..12fe2bfb4 100644 --- a/app/services/exports/lettings_log_export_service.rb +++ b/app/services/exports/lettings_log_export_service.rb @@ -198,8 +198,8 @@ module Exports attribute_hash["sheltered"] = lettings_log.sheltered attribute_hash["nocharge"] = lettings_log.household_charge == 1 ? 1 : nil attribute_hash["chcharge"] = lettings_log.chcharge - add_scheme_fields!(lettings_log.scheme, attribute_hash) - add_location_fields!(lettings_log.location, attribute_hash) + add_scheme_fields!(lettings_log.scheme, attribute_hash) if lettings_log.scheme + add_location_fields!(lettings_log.location, attribute_hash) if lettings_log.location attribute_hash.delete("unittype_gn") end attribute_hash