Skip to content

Commit

Permalink
Convert query args to int (#40)
Browse files Browse the repository at this point in the history
* Convert query args to int

* Bump version
  • Loading branch information
fcollonval committed May 20, 2020
1 parent 5ca870c commit 3d984d0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ jupyter labextension install .

## Changelog

### 3.3.1

- Bugs
- Fix export always from history (settings ignored)

### 3.3.0

- Features
Expand Down
2 changes: 1 addition & 1 deletion jupyter_conda/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (3, 3, 0)
version_info = (3, 3, 1)
__version__ = ".".join(map(str, version_info))
10 changes: 5 additions & 5 deletions jupyter_conda/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ async def get(self):
Raises:
500 if an error occurs
"""
whitelist = self.get_query_argument("whitelist", 0)
list_envs = await self.env_manager.list_envs(int(whitelist) == 1)
whitelist = int(self.get_query_argument("whitelist", 0))
list_envs = await self.env_manager.list_envs(whitelist == 1)
if "error" in list_envs:
self.set_status(500)
self.finish(tornado.escape.json_encode(list_envs))
Expand Down Expand Up @@ -236,8 +236,8 @@ async def get(self, env: str):
history: 0 (default) or 1
"""
status = self.get_query_argument("status", "installed")
download = self.get_query_argument("download", 0)
history = self.get_query_argument("history", 0)
download = int(self.get_query_argument("download", 0))
history = int(self.get_query_argument("history", 0))

if download:
# export requirements file
Expand Down Expand Up @@ -333,7 +333,7 @@ def post(self, env: str):
"""
body = self.get_json_body()
packages = body["packages"]
develop = self.get_query_argument("develop", 0)
develop = int(self.get_query_argument("develop", 0))

if develop:
idx = self._stack.put(self.env_manager.develop_packages, env, packages)
Expand Down
2 changes: 1 addition & 1 deletion jupyter_conda/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def test_get_has_update(self):
def test_env_export(self):
n = generate_name()
self.wait_for_task(self.mk_env, n)
r = self.conda_api.get(["environments", n], params={"download": 1})
r = self.conda_api.get(["environments", n], params={"download": 1, "history": 0})
self.assertEqual(r.status_code, 200)

content = r.text
Expand Down

0 comments on commit 3d984d0

Please sign in to comment.