Skip to content
GitLab
Explore
Sign in
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
abb9c05b
Commit
abb9c05b
authored
4 years ago
by
Dariusz Kędzierski
Browse files
Options
Downloads
Patches
Plain Diff
Fix: all types other than str will be trated as invalid account name string
parent
ffd4b027
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Fix: all types other than str will be trated as invalid account name string
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/indexer/accounts.py
+3
-7
3 additions, 7 deletions
hive/indexer/accounts.py
with
3 additions
and
7 deletions
hive/indexer/accounts.py
+
3
−
7
View file @
abb9c05b
...
@@ -58,19 +58,15 @@ class Accounts:
...
@@ -58,19 +58,15 @@ class Accounts:
@classmethod
@classmethod
def
get_id
(
cls
,
name
):
def
get_id
(
cls
,
name
):
"""
Get account id by name. Throw if not found.
"""
"""
Get account id by name. Throw if not found.
"""
if
isinstance
(
name
,
list
):
assert
name
[
0
]
in
cls
.
_ids
,
"
account does not exist or was not registered
"
return
cls
.
_ids
[
name
[
0
]]
assert
name
in
cls
.
_ids
,
"
account does not exist or was not registered
"
assert
name
in
cls
.
_ids
,
"
account does not exist or was not registered
"
return
cls
.
_ids
[
name
]
return
cls
.
_ids
[
name
]
@classmethod
@classmethod
def
exists
(
cls
,
name
):
def
exists
(
cls
,
name
):
"""
Check if an account name exists.
"""
"""
Check if an account name exists.
"""
if
isinstance
(
name
,
list
):
if
isinstance
(
name
,
str
):
return
name
[
0
]
in
cls
.
_ids
return
name
in
cls
.
_ids
return
name
in
cls
.
_ids
return
False
@classmethod
@classmethod
def
register
(
cls
,
names
,
block_date
):
def
register
(
cls
,
names
,
block_date
):
...
...
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