Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
51407c65
Commit
51407c65
authored
Nov 19, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
return db_data if source not found
parent
dff4e9c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/api/catalog/views/function.py
View file @
51407c65
...
...
@@ -22,7 +22,12 @@ class FunctionViewSet(BulkViewSet):
def
_get_external_info
(
self
,
db_data
):
detailed_info_retriever
=
GetFunctionExternalInfo
(
db_data
[
'function_id'
],
db_data
[
'source'
])
detailed_data
=
detailed_info_retriever
.
get_details
()
# @TODO check consistency?
try
:
detailed_data
=
detailed_info_retriever
.
get_details
()
except
NotImplementedError
as
not_implemented_error
:
logger
.
warning
(
"Could not found API for the source, returning item from the DB. Error: %s"
%
not_implemented_error
)
detailed_data
=
db_data
return
detailed_data
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
backend/metagenedb/common/utils/external_api/togows.py
View file @
51407c65
...
...
@@ -15,8 +15,7 @@ class GetFunctionExternalInfo:
self
.
source
=
source
def
_get_unknown_source
(
self
):
logger
.
warning
(
"No source of information for %s from %s"
%
(
self
.
function_id
,
self
.
source
))
raise
NotImplementedError
raise
NotImplementedError
(
"No source of information for %s from %s"
%
(
self
.
function_id
,
self
.
source
))
def
_get_kegg
(
self
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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