Skip to content

Get endpoint for phase descriptors fails #972

Open
@ashesman

Description

@ashesman

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})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions