Skip to content

Experiment Web API ends up looking for a 'declaration' attribute while it has none

When pulling an experiment using the cmdline interface, there is a call to the GET method of RetrieveUpdateDestroyExperimentView. Unfortunately, this call leads to the following problem:

It's asking for the field 'declaration' of ExperimentResultsSerializer, but this class has no such field. It ends up with:

  File "/idiap/project/beat/beat.env.develop/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 466, in data
    ret = super(Serializer, self).data
  File "/idiap/project/beat/beat.env.develop/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 213, in data
    self._data = self.to_representation(self.instance)
  File "/idiap/project/beat/beat.env.develop/usr/lib/python2.7/site-packages/rest_framework/serializers.py", line 435, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/idiap/project/beat/beat.env.develop/usr/lib/python2.7/site-packages/rest_framework/fields.py", line 1323, in to_representation
    return method(value)
  File "/remote/idiap.svm/user.active/lelshafey/work/beat_platform/beat.web/beat/web/common/serializers.py", line 289, in get_declaration
    return json.dumps(obj.declaration, indent=4)
AttributeError: 'Experiment' object has no attribute 'declaration'