Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs_control doesn't understand a spectroscopy request entry #171

Open
KKruszynska opened this issue Jul 2, 2024 · 1 comment
Open

obs_control doesn't understand a spectroscopy request entry #171

KKruszynska opened this issue Jul 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@KKruszynska
Copy link
Collaborator

While including a new feature for MOP, I encountered an error from obs_control.extract_obs_request_info when it tried to read a spectroscopy request for FLOYDS and looked for a 'filter' keyword. Specrosocopy doesn't have that keyword, so it causes an error while loading the active obs view.

For now, I will create a placeholder code and do nothing when a spectroscopy request is encountered.
We will need to implement better handling of a spectroscopy request.

Error:

Internal Server Error: /activeobs/
Traceback (most recent call last):
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 199, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 362, in process_exception_by_middleware
    response = middleware_method(request, exception)
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/tom_common/middleware.py", line 29, in process_exception
    raise exception
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/katarzyna/mop_venv/lib/python3.10/site-packages/django/views/generic/list.py", line 174, in get
    context = self.get_context_data()
  File "/home/katarzyna/mop/mop/views.py", line 170, in get_context_data
    pending_obs = parse_lco_requestgroups(response, short_form=False, pending_only=False)
  File "/home/katarzyna/mop/mop/toolbox/obs_control.py", line 71, in parse_lco_requestgroups
    obs_info = extract_obs_request_info(result)
  File "/home/katarzyna/mop/mop/toolbox/obs_control.py", line 104, in extract_obs_request_info
    obs_info['filters'].append(inst_conf['optical_elements']['filter'])
KeyError: 'filter'

@KKruszynska KKruszynska added the bug Something isn't working label Jul 2, 2024
@KKruszynska
Copy link
Collaborator Author

I added placeholder code with commit number 3fd5f63.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants