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
b5354428
Commit
b5354428
authored
4 years ago
by
Gandalf
Committed by
Jason Salyers
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[JES] Full tests found a couple of more bugs. Fix an await, make sure there is an observer
parent
d7c8b89d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/server/bridge_api/methods.py
+8
-4
8 additions, 4 deletions
hive/server/bridge_api/methods.py
with
8 additions
and
4 deletions
hive/server/bridge_api/methods.py
+
8
−
4
View file @
b5354428
...
...
@@ -85,13 +85,16 @@ async def get_post(context, author, permlink, observer=None):
valid_account
(
author
)
valid_permlink
(
permlink
)
blacklists_for_user
=
None
if
observer
and
context
:
blacklists_for_user
=
await
Mutes
.
get_blacklists_for_observer
(
observer
,
context
)
sql
=
"
---bridge_api.get_post
\n
"
+
SELECT_FRAGMENT
+
"""
WHERE hive_posts_cache.author = :author AND hive_posts_cache.permlink = :permlink AND NOT hive_posts.is_deleted
"""
result
=
await
db
.
query_all
(
sql
,
author
=
author
,
permlink
=
permlink
)
assert
len
(
result
)
==
1
,
'
invalid author/permlink or post not found in cache
'
post
=
_condenser_post_object
(
result
[
0
])
blacklists_for_user
=
Mutes
.
get_blacklists_for_observer
(
observer
,
context
)
post
[
'
blacklists
'
]
=
await
append_statistics_to_post
(
post
,
result
[
0
],
False
,
blacklists_for_user
)
post
=
await
append_statistics_to_post
(
post
,
result
[
0
],
False
,
blacklists_for_user
)
return
post
@return_error_info
...
...
@@ -285,7 +288,7 @@ async def get_account_posts(context, sort, account, start_author='', start_perml
posts
=
[]
blacklists_for_user
=
None
if
observer
:
blacklists_for_user
=
Mutes
.
get_blacklists_for_observer
(
observer
,
context
)
blacklists_for_user
=
await
Mutes
.
get_blacklists_for_observer
(
observer
,
context
)
sql_result
=
await
db
.
query_all
(
sql
,
account
=
account
,
author
=
start_author
,
permlink
=
start_permlink
,
limit
=
limit
)
for
row
in
sql_result
:
post
=
_condenser_post_object
(
row
)
...
...
@@ -327,4 +330,5 @@ async def get_relationship_between_accounts(context, account1, account2, observe
if
row
[
'
follow_blacklists
'
]:
result
[
'
follows_blacklists
'
]
=
True
return
result
\ No newline at end of file
return
result
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