Closed guynir42 closed 2 years ago
Hello @guynir42! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:
@stefanv ready for re-review.
It's a bit scary that we don't have tests for baselayer :/ Fortunately, it's well tested throug SkyPortal. Thanks @guy.
We need to inherit
get_query_handler
to deal with situations where the expected output is a boolean, not a string.Example:
do_something = self.get_query_argument("doSomething", False)
followed byif do_something:
will do the following:doSomething
is not given in the query, returnFalse
, which is desired behavior."True"
then theif
will evaluate it as true. Desired behavior."False"
which theif
takes as true. This is the wrong behavior.Instead, we override the
get_query_argument
function to act differently if given a default boolean. In that case, it will interpret any of the following inputs:['true', 't', 'yes', '1']
(in a case insensitive manner) as true. All other values are interpreted as false.