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
d21bc4ae
Commit
d21bc4ae
authored
4 years ago
by
Jason Salyers
Browse files
Options
Downloads
Patches
Plain Diff
[JES] Check that blackilsts exist before trying to reference them
parent
56329e2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!456
Release candidate v1 24
,
!370
Jsalyers muting at sql level
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/db/sql_scripts/bridge_get_ranked_post_for_all.sql
+1
-1
1 addition, 1 deletion
hive/db/sql_scripts/bridge_get_ranked_post_for_all.sql
hive/server/bridge_api/objects.py
+1
-1
1 addition, 1 deletion
hive/server/bridge_api/objects.py
with
2 additions
and
2 deletions
hive/db/sql_scripts/bridge_get_ranked_post_for_all.sql
+
1
−
1
View file @
d21bc4ae
...
...
@@ -52,11 +52,11 @@ BEGIN
FROM
hive_posts
hp1
JOIN
hive_accounts_view
ha
ON
hp1
.
author_id
=
ha
.
id
WHERE
hp1
.
counter_deleted
=
0
AND
hp1
.
depth
=
0
AND
NOT
ha
.
is_grayed
AND
(
__post_id
=
0
OR
hp1
.
id
<
__post_id
)
AND
(
CASE
WHEN
_observer
<>
''
THEN
hp
.
aouthor
NOT
IN
(
SELECT
muted
FROM
muted_accounts_view
WHERE
observer
=
_observer
)
ELSE
True
END
)
ORDER
BY
hp1
.
id
DESC
LIMIT
_limit
)
as
created
JOIN
hive_posts_view
hp
ON
hp
.
id
=
created
.
id
WHERE
(
CASE
WHEN
_observer
<>
''
THEN
hp
.
author
NOT
IN
(
SELECT
muted
FROM
muted_accounts_view
WHERE
observer
=
_observer
)
ELSE
True
END
)
ORDER
BY
created
.
id
DESC
LIMIT
_limit
;
END
...
...
This diff is collapsed.
Click to expand it.
hive/server/bridge_api/objects.py
+
1
−
1
View file @
d21bc4ae
...
...
@@ -19,7 +19,7 @@ def append_statistics_to_post(post, row, is_pinned, blacklists_for_user=[], over
"""
apply information such as blacklists and community names/roles to a given post
"""
post
[
'
blacklists
'
]
=
[]
if
row
[
'
author
'
]
in
blacklists_for_user
:
if
blacklists_for_user
and
row
[
'
author
'
]
in
blacklists_for_user
:
blacklists
=
blacklists_for_user
[
row
[
'
author
'
]]
for
blacklist
in
blacklists
:
post
[
'
blacklists
'
].
append
(
blacklist
)
...
...
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