Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
23f457e9
Commit
23f457e9
authored
5 years ago
by
roadscape
Browse files
Options
Downloads
Patches
Plain Diff
use account posting_json_metadata, close
#229
parent
ddabe6c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hive/indexer/accounts.py
+1
-1
1 addition, 1 deletion
hive/indexer/accounts.py
hive/utils/account.py
+1
-1
1 addition, 1 deletion
hive/utils/account.py
tests/utils/test_utils_account.py
+1
-1
1 addition, 1 deletion
tests/utils/test_utils_account.py
with
3 additions
and
3 deletions
hive/indexer/accounts.py
+
1
−
1
View file @
23f457e9
...
@@ -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
'
],
...
...
This diff is collapsed.
Click to expand it.
hive/utils/account.py
+
1
−
1
View file @
23f457e9
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
tests/utils/test_utils_account.py
+
1
−
1
View file @
23f457e9
...
@@ -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
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment