Skip to content
Snippets Groups Projects
Commit 23f457e9 authored by roadscape's avatar roadscape
Browse files

use account posting_json_metadata, close #229

parent ddabe6c3
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,7 @@ class Accounts: ...@@ -158,7 +158,7 @@ class Accounts:
# pull out valid profile md and delete the key # pull out valid profile md and delete the key
profile = safe_profile_metadata(account) profile = safe_profile_metadata(account)
del account['json_metadata'] del account['posting_json_metadata']
active_at = max(account['created'], active_at = max(account['created'],
account['last_post'], account['last_post'],
......
...@@ -7,7 +7,7 @@ def safe_profile_metadata(account): ...@@ -7,7 +7,7 @@ def safe_profile_metadata(account):
"""Given an account, return sanitized profile data.""" """Given an account, return sanitized profile data."""
prof = {} prof = {}
try: try:
prof = json.loads(account['json_metadata'])['profile'] prof = json.loads(account['posting_json_metadata'])['profile']
if not isinstance(prof, dict): if not isinstance(prof, dict):
prof = {} prof = {}
except Exception: except Exception:
......
...@@ -12,7 +12,7 @@ def test_valid_account(): ...@@ -12,7 +12,7 @@ def test_valid_account():
cover_image='https://steemitimages.com/0x0/https://pbs.twimg.com/profile_banners/816255358066946050/1483447009/1500x500', 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', 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) safe_profile = safe_profile_metadata(account)
for key, safe_value in safe_profile.items(): for key, safe_value in safe_profile.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment