sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Fix async problem of event query within Jupyter notebook #173

Closed taldcroft closed 4 years ago

taldcroft commented 4 years ago

Description

In addition, set DJANGO_ALLOW_ASYNC_UNSAFE, to avoid exception seen running in Jupyter notebook: SynchronousOnlyOperation: You cannot call this from an async context.

See: https://stackoverflow.com/questions/59119396.

Testing

Functional testing

Made a jupyter notebook with a single cell:

from kadi import events
safe_modes = events.safe_suns
safe_modes.table

Before this PR that would generate the SynchronousOnlyOperation exception. After the PR it runs correctly and produces the expected output.

Fixes #171