Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix business potential returned by company export wins endpoint. #5616

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datahub/company/test/test_company_exportwins_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_get_export_wins_success(self, not_matched):
'created': format_date_or_datetime(win.created_on),
'country': win.country.iso_alpha2_code,
'sector': win.sector.name,
'business_potential': win.business_potential.export_win_id,
'business_potential': win.business_potential.name,
'business_type': win.business_type,
'name_of_export': win.name_of_export,
# this field is intentionally duplicated to match legacy system output
Expand Down
2 changes: 1 addition & 1 deletion datahub/export_win/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def get_sector(self, win):
def get_business_potential(self, win):
"""Return human readable name for business type."""
if win.business_potential:
return win.business_potential.export_win_id
return win.business_potential.name
return None

def get_response(self, win):
Expand Down