TOMToolkit / tom_base

The base Django project for a Target and Observation Manager
https://tom-toolkit.readthedocs.io
GNU General Public License v3.0
26 stars 46 forks source link

Lasair settings dictionary has wrong case key + multiple API keys needed in future #1062

Closed talister closed 1 month ago

talister commented 1 month ago

Describe the bug This bug report is in two parts, the second part may be better spun-off into a separate feature request.

  1. The dictionary key for holding the Lasair API key in the BROKERS section of the tom_setup/templates/tom_setup/settings.tmpl has the incorrect case (Lasair vs LASAIR) causing attempts to use the Lasair broker within TOM Toolkit to break (specifically attempts to use tom_alerts/brokers/lasair.LasairBroker.fetch_alerts())
  2. Lasair-ZTF and Lasair-LSST (currently?) require separate accounts which have separate API keys; support for handling both flavors of broker and their separate API keys should be added, particularly as ZTF is funded to continue for the next 2 years.

To Reproduce Steps to reproduce the behavior:

  1. Start with a new version of tomtoolkit and run python ./manage.py tom_setup (or use make-tom/make-tom.sh)
  2. Add Lasair API key to the api_key section of ['BROKERS']['Lasair'] in the settings.py and attempt to use the Lasair Query form
  3. Fails with Requires a 'api_key' in settings.BROKERS['LASAIR']. Log in or create an account at https://lasair-ztf.lsst.ac.uk/ to acquire an API token.

Expected behavior Queries should work. Support for querying both ZTF and LSST through Lasair is desirable.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

jchate6 commented 1 month ago

This is correct in the docs but not in the template.

jchate6 commented 1 month ago

I spun off the 2nd part of this into issue #1066