ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Deleting a measurement is broken #116

Closed ivoflipse closed 10 years ago

ivoflipse commented 10 years ago

Delete measurement is trying to access a local copy (to get the id probably), but that's no longer how it works.

    def delete_measurement(self):
        current_item = self.measurement_tree.currentItem()
        index = self.measurement_tree.indexFromItem(current_item).row()
        measurement = self.measurements[index]
        message = "Are you sure you want to delete measurement: {}?".format(measurement.measurement_name)
        self.dialog = gui.Dialog(message=message, title="Delete measurement?", parent=self)
        response = self.dialog.exec_()
        if response:
            self.model.delete_measurement(measurement=measurement)
Traceback (most recent call last):
  File "C:\Dropbox\Development\Footlabeling\footlabeling\widgets\database\measurementwidget.py", line 117, in delete_measurement
    measurement = self.measurements[index]
AttributeError: 'MeasurementWidget' object has no attribute 'measurements'
ivoflipse commented 10 years ago

Odd, I didn't encounter this error when working on #113 so I'm assuming this is fixed