Skip to content

Commit

Permalink
Merge pull request #5353 from uktrade/fix/update-lead-officer-email-link
Browse files Browse the repository at this point in the history
Update Lead officer email link.
  • Loading branch information
elcct authored Apr 10, 2024
2 parents 3b6f0e9 + 035a6e6 commit 10a719a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ def _build_redis_url(base_url, db_number, **query_args):
default='',
)
EXPORT_WIN_CLIENT_REVIEW_WIN_URL=f'{DATAHUB_FRONTEND_BASE_URL}/exportwins/review'
EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL=f'{DATAHUB_FRONTEND_BASE_URL}/exportwins/{{uuid}}/details'
EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL=\
f'{DATAHUB_FRONTEND_BASE_URL}/companies/{{company_id}}/exportwins/{{uuid}}/edit?step=summary'

NOTIFICATION_SUMMARY_THRESHOLD = env.int(
'NOTIFICATION_SUMMARY_THRESHOLD',
Expand Down
10 changes: 8 additions & 2 deletions datahub/export_win/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def get_all_fields_for_lead_officer_email_receipt_no(customer_response):
'lead_officer_first_name': win.lead_officer.first_name,
'goods_services': win.goods_vs_services.name,
'client_company_name': win.company.name,
'url': settings.EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL.format(uuid=win.id),
'url': settings.EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL.format(
company_id=win.company.id,
uuid=win.id,
),
}

return details
Expand All @@ -146,7 +149,10 @@ def get_all_fields_for_lead_officer_email_receipt_yes(customer_response):
'total_export_win_value': total_export_win_value,
'goods_services': win.goods_vs_services.name,
'client_company_name': win.company.name,
'url': settings.EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL.format(uuid=win.id),
'url': settings.EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL.format(
company_id=win.company.id,
uuid=win.id,
),
}

return details
Expand Down
8 changes: 6 additions & 2 deletions datahub/export_win/test/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ def test_get_all_fields_for_lead_officer_email_receipt_no_success():
assert result['goods_services'] == win.goods_vs_services.name
assert result['client_company_name'] == contact.company.name
assert result['url'] == settings.EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL.format(
uuid=win.id)
company_id=win.company.id,
uuid=win.id,
)


def test_get_all_fields_for_lead_officer_email_receipt_yes_success():
Expand Down Expand Up @@ -632,4 +634,6 @@ def test_get_all_fields_for_lead_officer_email_receipt_yes_success():
assert result['goods_services'] == win.goods_vs_services.name
assert result['client_company_name'] == contact.company.name
assert result['url'] == settings.EXPORT_WIN_LEAD_OFFICER_REVIEW_WIN_URL.format(
uuid=win.id)
company_id=win.company.id,
uuid=win.id,
)

0 comments on commit 10a719a

Please sign in to comment.