diff --git a/src/authentic2_auth_fedict/fields.py b/src/authentic2_auth_fedict/fields.py index 33e907e..a3547b5 100644 --- a/src/authentic2_auth_fedict/fields.py +++ b/src/authentic2_auth_fedict/fields.py @@ -16,6 +16,7 @@ # along with this program. If not, see . import time +from urllib.parse import urljoin from django import forms from django.conf import settings @@ -112,7 +113,7 @@ class CountryWidget(forms.Select): country_url = settings.IMIO_COUNTRY_URL else: passerelle_url = list(settings.KNOWN_SERVICES['passerelle'].values())[0]['url'] - country_url = '%s/csvdatasource/pays/data' % passerelle_url + country_url = urljoin(passerelle_url, '/csvdatasource/pays/data') try: self.choices = [(x['id'], x['text']) for x in requests.get(country_url).json()['data']] except ValueError: