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
ad2a0bae
Commit
ad2a0bae
authored
4 years ago
by
Bartek Wrona
Browse files
Options
Downloads
Plain Diff
branch 'pmaniora_observer_validation' rebased onto develop
parents
c88de80e
1d0a9167
No related branches found
Branches containing commit
Tags
0.19.35
Tags containing commit
2 merge requests
!456
Release candidate v1 24
,
!280
observer validation
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/server/bridge_api/methods.py
+2
-2
2 additions, 2 deletions
hive/server/bridge_api/methods.py
tests/tests_api
+1
-1
1 addition, 1 deletion
tests/tests_api
with
3 additions
and
3 deletions
hive/server/bridge_api/methods.py
+
2
−
2
View file @
ad2a0bae
...
@@ -53,6 +53,7 @@ async def get_post(context, author, permlink, observer=None):
...
@@ -53,6 +53,7 @@ async def get_post(context, author, permlink, observer=None):
#TODO: `observer` logic for user-post state
#TODO: `observer` logic for user-post state
db
=
context
[
'
db
'
]
db
=
context
[
'
db
'
]
valid_account
(
author
)
valid_account
(
author
)
valid_account
(
observer
,
allow_empty
=
True
)
valid_permlink
(
permlink
)
valid_permlink
(
permlink
)
blacklists_for_user
=
None
blacklists_for_user
=
None
...
@@ -286,6 +287,7 @@ async def get_account_posts(context, sort:str, account:str, start_author:str='',
...
@@ -286,6 +287,7 @@ async def get_account_posts(context, sort:str, account:str, start_author:str='',
account
=
valid_account
(
account
)
account
=
valid_account
(
account
)
start_author
=
valid_account
(
start_author
,
allow_empty
=
True
)
start_author
=
valid_account
(
start_author
,
allow_empty
=
True
)
start_permlink
=
valid_permlink
(
start_permlink
,
allow_empty
=
True
)
start_permlink
=
valid_permlink
(
start_permlink
,
allow_empty
=
True
)
observer
=
valid_account
(
observer
,
allow_empty
=
True
)
limit
=
valid_limit
(
limit
,
100
,
20
)
limit
=
valid_limit
(
limit
,
100
,
20
)
sql
=
None
sql
=
None
...
@@ -304,8 +306,6 @@ async def get_account_posts(context, sort:str, account:str, start_author:str='',
...
@@ -304,8 +306,6 @@ async def get_account_posts(context, sort:str, account:str, start_author:str='',
elif
sort
==
'
payout
'
:
elif
sort
==
'
payout
'
:
sql
=
"
SELECT * FROM bridge_get_account_posts_by_payout( (:account)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT )
"
sql
=
"
SELECT * FROM bridge_get_account_posts_by_payout( (:account)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT )
"
observer
=
valid_account
(
observer
,
allow_empty
=
True
)
sql_result
=
await
db
.
query_all
(
sql
,
account
=
account
,
author
=
start_author
,
permlink
=
start_permlink
,
limit
=
limit
)
sql_result
=
await
db
.
query_all
(
sql
,
account
=
account
,
author
=
start_author
,
permlink
=
start_permlink
,
limit
=
limit
)
posts
=
[]
posts
=
[]
blacklists_for_user
=
None
blacklists_for_user
=
None
...
...
This diff is collapsed.
Click to expand it.
tests_api
@
3d3daf0c
Compare
a67fd2e5
...
3d3daf0c
Subproject commit
a67fd2e56ecf35b254d5f901767802524fe6f39e
Subproject commit
3d3daf0c67b9d429be51b2d66543a57c0f8fcf29
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