From c029e337f5b7c7e9beb7d7fc3c1301f82fbfb344 Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:07:42 +0100 Subject: [PATCH 1/2] test --- services/invitations/tests/unit/api/test_api_invitations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/invitations/tests/unit/api/test_api_invitations.py b/services/invitations/tests/unit/api/test_api_invitations.py index 751a0a96bb9..84f97fb45fe 100644 --- a/services/invitations/tests/unit/api/test_api_invitations.py +++ b/services/invitations/tests/unit/api/test_api_invitations.py @@ -41,6 +41,10 @@ def test_create_invitation( assert invitation.guest == invitation_input.guest assert invitation.trial_account_days == invitation_input.trial_account_days + # checks issue with `//` reported in https://github.com/ITISFoundation/osparc-simcore/issues/7055 + assert invitation.invitation_url + assert invitation.invitation_url.path == "/" + assert invitation.product if invitation_input.product: assert invitation.product == invitation_input.product From a6c800e47cfc2208f13ceb601651ecb05f002e9e Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:07:48 +0100 Subject: [PATCH 2/2] fix --- .../src/simcore_service_invitations/services/invitations.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/invitations/src/simcore_service_invitations/services/invitations.py b/services/invitations/src/simcore_service_invitations/services/invitations.py index d6065b08d0c..6200dcf6408 100644 --- a/services/invitations/src/simcore_service_invitations/services/invitations.py +++ b/services/invitations/src/simcore_service_invitations/services/invitations.py @@ -64,8 +64,7 @@ def _build_link( r = URL("/registration").include_query_params(invitation=code_url_safe) # Adds query to fragment - base_url = f"{base_url}/" - url = URL(base_url).replace(fragment=f"{r}") + url = URL(f"{base_url.rstrip('/')}/").replace(fragment=f"{r}") return TypeAdapter(HttpUrl).validate_python(f"{url}")