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

Get endpoint for phase descriptors fails #972

Open
ashesman opened this issue Nov 24, 2020 · 0 comments
Open

Get endpoint for phase descriptors fails #972

ashesman opened this issue Nov 24, 2020 · 0 comments

Comments

@ashesman
Copy link

ashesman commented Nov 24, 2020

Using frontend_example.py, the web gui issues an HTTP error. I have tracked it down to the GET of phase groups. See code below. test.descriptor.phase_group does not exists at that time it is read.

Replacing line 360 with phase_descriptors = [] solves the HTTP error in the web gui showing that the initialisation of that array is the issue, but obviously is not a fix!

At that time, test.descriptor.phase_sequence.nodes exists, but does not work as a suitable replacement for phase_group. The exception is gone, but the HTTP response error still occurs.

Line 351 of station_server.py ...

class PhasesHandler(BaseTestHandler):
  """GET endpoint for phase descriptors for a test, i.e. the full phase list."""

  def get(self, test_uid):
    test, _ = self.get_test(test_uid)

    if test is None:
      return

    phase_descriptors = [
        dict(id=id(phase), **data.convert_to_base_types(phase))
        for phase in test.descriptor.phase_group
    ]

    # Wrap value in a dict because writing a list directly is prohibited.
    self.write({'data': phase_descriptors})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant