From fbbf6e7e115344f6d9f476c62cd110985de17cde Mon Sep 17 00:00:00 2001 From: Pawel Szymanski Date: Tue, 7 May 2024 17:38:38 +0100 Subject: [PATCH] Fix hvc codes in Export win dataset. --- datahub/dataset/export_wins/test/test_views.py | 2 +- datahub/dataset/export_wins/views.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/datahub/dataset/export_wins/test/test_views.py b/datahub/dataset/export_wins/test/test_views.py index c6ae2a61c..19d8afa1e 100644 --- a/datahub/dataset/export_wins/test/test_views.py +++ b/datahub/dataset/export_wins/test/test_views.py @@ -306,7 +306,7 @@ def _assert_win_matches_result( 'date': format_date_or_datetime(win.date), 'description': win.description, 'has_hvo_specialist_involvement': win.has_hvo_specialist_involvement, - 'hvc': win.hvc.export_win_id, + 'hvc': f'{win.hvc.campaign_id}{win.hvc.financial_year}', 'is_e_exported': win.is_e_exported, 'is_line_manager_confirmed': win.is_line_manager_confirmed, 'is_personally_confirmed': win.is_personally_confirmed, diff --git a/datahub/dataset/export_wins/views.py b/datahub/dataset/export_wins/views.py index cb3fffe9b..c53dbb2b2 100644 --- a/datahub/dataset/export_wins/views.py +++ b/datahub/dataset/export_wins/views.py @@ -351,7 +351,10 @@ def get_dataset(self): output_field=BooleanField(), ), country=F('country__iso_alpha2_code'), - hvc=F('hvc__export_win_id'), + hvc=Concat( + Cast('hvc__campaign_id', CharField()), + Cast('hvc__financial_year', CharField()), + ), user__email=F('adviser__contact_email'), user__name=Concat( 'adviser__first_name',