Skip to content

Commit ecd7ff2

Browse files
committed
SPs can have no registrationAuthority
1 parent 797fa54 commit ecd7ff2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pyff/samlmd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@ def entity_extended_display_i18n(entity, default_lang=None):
700700

701701
def registration_authority(entity):
702702
regauth_el = entity.find(".//{%s}RegistrationInfo" % NS['mdrpi'])
703-
return regauth_el.attrib.get('registrationAuthority')
703+
if regauth_el is not None:
704+
return regauth_el.attrib.get('registrationAuthority')
704705

705706

706707
def entity_extended_display(entity, langs=None):
@@ -801,8 +802,9 @@ def discojson(e, langs=None, fallback_to_favicon=False, icon_store=None):
801802
auth='saml',
802803
entity_id=entity_id,
803804
entityID=entity_id,
804-
registrationAuthority=registrationAuthority,
805805
)
806+
if registrationAuthority is not None:
807+
d['registrationAuthority'] = registrationAuthority
806808

807809
eattr = entity_attribute_dict(e)
808810
if 'idp' in eattr[ATTRS['role']]:

0 commit comments

Comments
 (0)