From 23f457e9989e34fe34bde959d886200e1031a86c Mon Sep 17 00:00:00 2001 From: roadscape <roadscape@users.noreply.github.com> Date: Tue, 3 Sep 2019 15:37:22 -0500 Subject: [PATCH] use account posting_json_metadata, close #229 --- hive/indexer/accounts.py | 2 +- hive/utils/account.py | 2 +- tests/utils/test_utils_account.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hive/indexer/accounts.py b/hive/indexer/accounts.py index 9aceedcd0..a8b533161 100644 --- a/hive/indexer/accounts.py +++ b/hive/indexer/accounts.py @@ -158,7 +158,7 @@ class Accounts: # pull out valid profile md and delete the key profile = safe_profile_metadata(account) - del account['json_metadata'] + del account['posting_json_metadata'] active_at = max(account['created'], account['last_post'], diff --git a/hive/utils/account.py b/hive/utils/account.py index fe1302da6..0b2ad7729 100644 --- a/hive/utils/account.py +++ b/hive/utils/account.py @@ -7,7 +7,7 @@ def safe_profile_metadata(account): """Given an account, return sanitized profile data.""" prof = {} try: - prof = json.loads(account['json_metadata'])['profile'] + prof = json.loads(account['posting_json_metadata'])['profile'] if not isinstance(prof, dict): prof = {} except Exception: diff --git a/tests/utils/test_utils_account.py b/tests/utils/test_utils_account.py index b112e1126..9c4e726b8 100644 --- a/tests/utils/test_utils_account.py +++ b/tests/utils/test_utils_account.py @@ -12,7 +12,7 @@ def test_valid_account(): cover_image='https://steemitimages.com/0x0/https://pbs.twimg.com/profile_banners/816255358066946050/1483447009/1500x500', profile_image='https://www.parhlo.com/wp-content/uploads/2016/01/tmp617041537745813506.jpg', ) - account = {'name': 'foo', 'json_metadata': json.dumps(dict(profile=raw_profile))} + account = {'name': 'foo', 'posting_json_metadata': json.dumps(dict(profile=raw_profile))} safe_profile = safe_profile_metadata(account) for key, safe_value in safe_profile.items(): -- GitLab