Skip to content

Commit a749150

Browse files
fix: FilterAttributeValues: call mdstore only if available
1 parent fcbd4dd commit a749150

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/satosa/micro_services/attribute_modifications.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def _apply_filters(self, attributes, attribute_filters, context, target_provider
6262
filter_func = re.compile(filter_value).search
6363
elif filter_type == "shibmdscope_match_scope":
6464
mdstore = context.get_decoration(Context.KEY_METADATA_STORE)
65-
md_scopes = list(mdstore.shibmd_scopes(target_provider,"idpsso_descriptor"))
65+
md_scopes = list(mdstore.shibmd_scopes(target_provider,"idpsso_descriptor")) if mdstore else []
6666
filter_func = lambda v: self._shibmdscope_match_scope(v, md_scopes)
6767
elif filter_type == "shibmdscope_match_value":
6868
mdstore = context.get_decoration(Context.KEY_METADATA_STORE)
69-
md_scopes = list(mdstore.shibmd_scopes(target_provider,"idpsso_descriptor"))
69+
md_scopes = list(mdstore.shibmd_scopes(target_provider,"idpsso_descriptor")) if mdstore else []
7070
filter_func = lambda v: self._shibmdscope_match_value(v, md_scopes)
7171
else:
7272
raise SATOSAError("Unknown filter type")

0 commit comments

Comments
 (0)