cesium-ml / baselayer

Fully customizable (scientific, compute-intensive) web application template
http://cesium-ml.org/baselayer/
30 stars 18 forks source link

Boolean get_query_argument #285

Closed guynir42 closed 2 years ago

guynir42 commented 2 years ago

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 by if do_something: will do the following:

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.

pep8speaks commented 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:

Comment last updated at 2022-02-18 20:02:57 UTC
guynir42 commented 2 years ago

@stefanv ready for re-review.

stefanv commented 2 years ago

It's a bit scary that we don't have tests for baselayer :/ Fortunately, it's well tested throug SkyPortal. Thanks @guy.