Skip to content

Commit

Permalink
Merge pull request #8 from uw-it-aca/bug/mock-stable-hash
Browse files Browse the repository at this point in the history
more stable
  • Loading branch information
mikeseibel authored Feb 15, 2022
2 parents fde8f71 + efa8edf commit 4ba03a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions panopto_client/mock_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ def _normalized(self, params):
return {k: params[k] for k in params if k not in excluded}

def _param_hash(self, params):
h = md5(json.dumps(self._normalized(params), sort_keys=True).encode())
return h.hexdigest().upper()
return md5(json.dumps(
self._normalized(params),
default=lambda o: re.sub(r"[\s]*", "", str(o)),
sort_keys=True).encode()).hexdigest().upper()

def convert_to_platform_safe(self, dir_file_name):
"""
Expand Down

0 comments on commit 4ba03a6

Please sign in to comment.