ideonate / cdsdashboards

JupyterHub extension for ContainDS Dashboards
https://cdsdashboards.readthedocs.io/
Other
199 stars 38 forks source link

[Bug] Missing Callable case handling at async post for `conda_envs` #107

Closed viniciusdc closed 1 year ago

viniciusdc commented 1 year ago

Describe the bug It seems that there was a missing case for conda_envs:Callable here, which generates the following error when the post request is executed:

[E 2022-09-06 23:10:51.276 JupyterHub web:1798] Uncaught exception POST /hub/dashboards-new (10.244.0.1)
     HTTPServerRequest(protocol='http', host='***', method='POST', uri='/hub/dashboards-new', version='HTTP/1.1', remote_ip='10.244.0.1')
     Traceback (most recent call last):
       File "/opt/conda/lib/python3.9/site-packages/tornado/web.py", line 1713, in _execute
         result = await result 
       File "/opt/conda/lib/python3.9/site-packages/cdsdashboards/hubextension/main.py", line 270, in post 
         elif conda_env not in all_conda_envs:
     TypeError: argument of type 'functools.partial' is not iterable

 [E 2022-09-06 23:10:51.279 JupyterHub web:1221] Uncaught exception in write_error  
     Traceback (most recent call last):
       File "/opt/conda/lib/python3.9/site-packages/tornado/web.py", line 1219, in send_error
         self.write_error(status_code, **kwargs)
       File "/opt/conda/lib/python3.9/site-packages/jupyterhub/handlers/base.py", line 1293, in write_error
         self.write(html)
       File "/opt/conda/lib/python3.9/site-packages/tornado/web.py", line 843, in write
         raise TypeError(message)

     TypeError: write() only accepts bytes, unicode, and dict objects 

To Reproduce

Screenshots

Configuration

    c.CDSDashboardsConfig.conda_envs = partial(
        get_conda_environments, **kw
    )