Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
webservices
cern-search
cern-search-rest-api
Commits
9688e35d
Commit
9688e35d
authored
Oct 26, 2018
by
Pablo Panero
Browse files
Refactor: get_index_from_schema logging
parent
e878de73
Changes
1
Hide whitespace changes
Inline
Side-by-side
cern_search_rest_api/modules/cernsearch/utils.py
View file @
9688e35d
...
...
@@ -17,7 +17,10 @@ def get_user_provides():
def
get_index_from_request
(
record
=
None
):
if
record
is
not
None
and
record
.
get
(
'$schema'
,
''
)
is
not
None
:
return
cern_search_record_to_index
(
record
)
current_app
.
logger
.
debug
(
'get_index_from_schema() No record or no $schema in it, using defaults'
)
current_app
.
logger
.
debug
(
'get_index_from_schema(): Record {record} - $schema {schema}. Using defaults'
.
format
(
record
=
record
,
schema
=
'No record'
if
record
is
None
else
record
.
get
(
'$schema'
)
))
return
(
current_app
.
config
[
'INDEXER_DEFAULT_INDEX'
],
current_app
.
config
[
'INDEXER_DEFAULT_DOC_TYPE'
])
...
...
Write
Preview
Supports
Markdown
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