Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
elixir
beacon
Commits
567410a9
Commit
567410a9
authored
Jun 12, 2019
by
Jacek Lebioda
Browse files
Corrected `includeDatasetResponses` to accept string parameters
parent
03351ec4
Pipeline
#10635
passed with stage
in 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
code/backend/beacon/beacon.py
View file @
567410a9
...
...
@@ -61,11 +61,12 @@ class Beacon(object):
alleleRequest
=
query
)
if
truthy
(
query
.
get
(
'includeDatasetResponses'
,
False
)):
should_include_dataset_responses
=
query
.
get
(
'includeDatasetResponses'
,
""
)
if
len
(
should_include_dataset_responses
)
and
should_include_dataset_responses
!=
"NONE"
:
response
[
'datasetAlleleResponses'
]
=
[]
for
r
in
responses
:
response
[
'datasetA
llele
R
esponse
s'
].
append
(
create_beacon_dataset_allele_response_ok
(
datasetId
=
r
[
0
],
exists
=
r
[
1
])
)
a
llele
_r
esponse
=
create_beacon_dataset_allele_response_ok
(
datasetId
=
r
[
0
],
exists
=
bool
(
r
[
1
]))
response
[
'datasetAlleleResponses'
].
append
(
allele_response
)
except
(
NotImplementedError
,
Exception
)
as
error
:
response
=
create_beacon_allele_response_error
(
beaconId
=
beacon_id
,
...
...
code/backend/beacon/data_types.py
View file @
567410a9
...
...
@@ -96,11 +96,10 @@ def validate_input(**kwargs):
r
'^[AaCcTtGgDd]*$'
,
True
)
whitelist
=
[
True
,
False
,
'true'
,
'false'
,
'True'
,
'False'
]
if
'includeDatasetResponses'
in
kwargs
and
kwargs
[
'includeDatasetResponses'
]
not
in
whitelist
:
raise
APIArgumentError
(
"Invalid {0} ({1}) - {2}"
.
format
(
"includeDatasetResponses"
,
kwargs
[
'includeDatasetResponses'
],
'a boolean was expected'
))
wrap
(
'includeDatasetResponses'
,
'accepts only "ALL", "HIT", "MISS", "NONE" and empty string'
,
r
'^([Hh][Ii][Tt]$)|([Aa][Ll]{2}$)|([Mm][Ii][Ss]{2}$)|([Nn][Oo][Nn][Ee]$)|($)'
,
True
)
return
True
...
...
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