Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SOaAS
dbxref
Commits
bbfa8133
Commit
bbfa8133
authored
Jan 08, 2020
by
Lukas Jelonek
Browse files
Make code more robust against invalid ids
parent
26edf18a
Changes
1
Hide whitespace changes
Inline
Side-by-side
dbxref/resolver.py
View file @
bbfa8133
...
...
@@ -77,4 +77,8 @@ def convert_string_to_dbxref(string):
A dbxref is dictionary with two keys: db and id.
"""
split
=
string
.
split
(
':'
,
1
)
return
{
'db'
:
split
[
0
],
'id'
:
split
[
1
]}
if
len
(
split
)
>
1
:
return
{
'db'
:
split
[
0
],
'id'
:
split
[
1
]}
else
:
# invalid dbxref. nevertheless return a valid dbxref object with the value as the db and a empty id.
return
{
'db'
:
split
[
0
],
'id'
:
''
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment