sources/saml: fix `build_full_url` using incorrect URL parameter

This commit is contained in:
Jens Langhammer 2020-02-20 17:04:54 +01:00
parent e0272a6422
commit c8b3c6e51a
2 changed files with 3 additions and 2 deletions

View File

@ -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'<a href="{metadata_url}" class="btn btn-default btn-sm">Metadata Download</a>'

View File

@ -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})
)