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
5467b448
Commit
5467b448
authored
4 years ago
by
Dariusz Kędzierski
Committed by
Jason Salyers
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Follower and following entries must be strings. Same behaviour as in old hivemind
parent
b1f4457a
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/indexer/follow.py
+7
-10
7 additions, 10 deletions
hive/indexer/follow.py
with
7 additions
and
10 deletions
hive/indexer/follow.py
+
7
−
10
View file @
5467b448
...
@@ -104,18 +104,15 @@ class Follow(DbAdapterHolder):
...
@@ -104,18 +104,15 @@ class Follow(DbAdapterHolder):
op
[
'
following
'
]
=
op
[
'
following
'
]
if
isinstance
(
op
[
'
following
'
],
list
)
else
[
op
[
'
following
'
]]
op
[
'
following
'
]
=
op
[
'
following
'
]
if
isinstance
(
op
[
'
following
'
],
list
)
else
[
op
[
'
following
'
]]
# additional layer of protection against putting complex data types as user names
# additional layer of protection against putting complex data types as user names
as_str
=
[]
# we expecting follower and following entries to be strings
# in older hivemind this check was done in Accounts.exists
# now following can be list of names so we need to check if all entries are strings
for
following
in
op
[
'
following
'
]:
for
following
in
op
[
'
following
'
]:
if
isinstance
(
following
,
list
)
or
isinstance
(
following
,
dict
):
if
not
isinstance
(
following
,
str
):
as_str
.
append
(
dumps
(
following
))
return
None
else
:
as_str
.
append
(
str
(
following
))
op
[
'
following
'
]
=
as_str
if
isinstance
(
op
[
'
follower
'
],
list
)
or
isinstance
(
op
[
'
follower
'
],
dict
):
if
not
isinstance
(
op
[
'
follower
'
],
str
):
op
[
'
follower
'
]
=
dumps
(
op
[
'
follower
'
])
return
None
else
:
op
[
'
follower
'
]
=
str
(
op
[
'
follower
'
])
# follower/following is empty
# follower/following is empty
if
not
op
[
'
follower
'
]
or
not
op
[
'
following
'
]:
if
not
op
[
'
follower
'
]
or
not
op
[
'
following
'
]:
...
...
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