Skip to content

Commit

Permalink
Update CustomPrivacyRequestField.hash_value directly instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
pattisdr committed Jul 25, 2024
1 parent f35a8db commit a8a16d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fides/api/models/privacy_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ def hash_value(
cls,
value: MultiValue,
encoding: str = "UTF-8",
) -> Union[str, List[str]]:
) -> Optional[Union[str, List[str]]]:
"""Utility function to hash the value(s) with a generated salt"""

def hash_single_value(value: Union[str, int]) -> str:
Expand All @@ -1459,7 +1459,9 @@ def hash_single_value(value: Union[str, int]) -> str:
return hashed_value

if isinstance(value, list):
return [hash_single_value(item) for item in value]
# Skip hashing lists: this avoids us hashing and later indexing potentially large values and our index
# is not useful for array search anyway
return None
return hash_single_value(value)


Expand Down

0 comments on commit a8a16d3

Please sign in to comment.