diff --git a/spid_cie_oidc/authority/tests/test_06_advanced_entity_listing.py b/spid_cie_oidc/authority/tests/test_06_advanced_entity_listing.py index 7a822d85..be358f7b 100644 --- a/spid_cie_oidc/authority/tests/test_06_advanced_entity_listing.py +++ b/spid_cie_oidc/authority/tests/test_06_advanced_entity_listing.py @@ -15,7 +15,7 @@ def setUp(self): rp_onboarding_data_local = deepcopy(rp_onboarding_data) rp_onboarding_data_local["sub"] = "http://rp-test.it/oidc/rplocal/" FederationDescendant.objects.create(**rp_onboarding_data_local) - FederationEntityConfiguration.objects.create(**ta_conf_data) + self.ta = FederationEntityConfiguration.objects.create(**ta_conf_data) @override_settings(MAX_ENTRIES_PAGE=1) def test_advanced_entity_listing_1(self): diff --git a/spid_cie_oidc/authority/views.py b/spid_cie_oidc/authority/views.py index 93780265..4efaa16a 100644 --- a/spid_cie_oidc/authority/views.py +++ b/spid_cie_oidc/authority/views.py @@ -156,10 +156,18 @@ def advanced_entity_listing(request): ).order_by("-modified") entities_list = [] for descendant in desecendants: + try: + _ss = descendant.entity_statement_as_jws() + except AttributeError as e: + logger.warning( + f"Subordinate {descendant} missing authority hint: {e}" + ) + continue + entity = { descendant.sub : { "iat" : int(descendant.modified.timestamp()), - "subordinate_statement": descendant.entity_statement_as_jws() + "subordinate_statement": _ss } } entities_list.append(entity)