From c8b3c6e51a44983cb48f5f282f9578b6a5604518 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 20 Feb 2020 17:04:54 +0100 Subject: [PATCH] sources/saml: fix `build_full_url` using incorrect URL parameter --- passbook/sources/saml/models.py | 3 ++- passbook/sources/saml/utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/passbook/sources/saml/models.py b/passbook/sources/saml/models.py index 36356fdfa..578047ddb 100644 --- a/passbook/sources/saml/models.py +++ b/passbook/sources/saml/models.py @@ -11,6 +11,7 @@ class SAMLSource(Source): """SAML Source""" entity_id = models.TextField(blank=True, default=None, verbose_name=_("Entity ID")) + idp_url = models.URLField(verbose_name=_("IDP URL")) idp_logout_url = models.URLField( default=None, blank=True, null=True, verbose_name=_("IDP Logout URL") @@ -33,7 +34,7 @@ class SAMLSource(Source): @property def ui_additional_info(self) -> str: metadata_url = reverse_lazy( - "passbook_sources_saml:metadata", kwargs={"source_slug": self} + "passbook_sources_saml:metadata", kwargs={"source_slug": self.slug} ) return f'Metadata Download' diff --git a/passbook/sources/saml/utils.py b/passbook/sources/saml/utils.py index 4bd8b2b7f..27160b750 100644 --- a/passbook/sources/saml/utils.py +++ b/passbook/sources/saml/utils.py @@ -17,7 +17,7 @@ def get_entity_id(request: HttpRequest, source: SAMLSource): def build_full_url(view: str, request: HttpRequest, source: SAMLSource) -> str: """Build Full ACS URL to be used in IDP""" return request.build_absolute_uri( - reverse(f"passbook_sources_saml:{view}", kwargs={"source": source.slug}) + reverse(f"passbook_sources_saml:{view}", kwargs={"source_slug": source.slug}) )