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
1d0a9167
Commit
1d0a9167
authored
4 years ago
by
Pawel Maniora
Browse files
Options
Downloads
Patches
Plain Diff
observer validation
parent
45c28831
No related branches found
No related tags found
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 @
1d0a9167
...
@@ -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
@
7a2a2231
Compare
ecafd768
...
7a2a2231
Subproject commit
ecafd7682f26b8fdee3330ac32a8de9916a3d401
Subproject commit
7a2a223165ef5903db70e28335106d2c33feec49
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