Skip to content

Commit

Permalink
feature: apply_constraint failReason
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Simpson <[email protected]>
  • Loading branch information
Robert Simpson authored and Robert Simpson committed Nov 25, 2023
1 parent 0bbfa2c commit 78d72bf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ async def apply_constraint_received_cred(

for attrs in cred_dict.keys():
if attrs not in field_paths:
return f'{"at least one of " if isinstance(attrs, list) else ""}{attrs} not in field paths'
return f'No field in constraints for {"at least one of " if isinstance(attrs, list) else ""}{attrs}'
for nested_attr_key in nested_field_paths:
nested_attr_values = nested_field_paths[nested_attr_key]
extracted = self.nested_get(cred_dict, nested_attr_key)
Expand All @@ -1512,7 +1512,7 @@ def check_attr_in_extracted_dict(
"""If successful, returns None, otherwise returns string with reason for failure"""
for attrs in extracted_dict.keys():
if attrs not in nested_attr_values:
return f'{"at least one of " if isinstance(attrs, list) else ""}{attrs} not in field paths'
return f'No field in constraints for {"at least one of " if isinstance(attrs, list) else ""}{attrs}'
return None

def get_dict_keys_from_path(self, derived_cred_dict: dict, path: str) -> List:
Expand Down

0 comments on commit 78d72bf

Please sign in to comment.