Fix deletion of device calibration actions
Currently when we have a device calibration action with associated device properties, the database gives an error when we try to delete these action:
Delete object error: (psycopg2.errors.NotNullViolation) null value in column "calibration_action_id" violates not-null constraint DETAIL: Failing row contains (4, null, 212, 2021-07-07 06:58:16.505185, 3, 2021-07-07 07:11:27.605871, null). [SQL: UPDATE device_property_calibration SET updated_at=%(updated_at)s, calibration_action_id=%(calibration_action_id)s WHERE device_property_calibration.id = %(device_property_calibration_id)s] [parameters: ({'updated_at': datetime.datetime(2021, 7, 7, 7, 11, 27, 605871), 'calibration_action_id': None, 'device_property_calibration_id': 4}, {'updated_at': datetime.datetime(2021, 7, 7, 7, 11, 27, 605876), 'calibration_action_id': None, 'device_property_calibration_id': 5}, {'updated_at': datetime.datetime(2021, 7, 7, 7, 11, 27, 605878), 'calibration_action_id': None, 'device_property_calibration_id': 6})] (Background on this error at: http://sqlalche.me/e/13/gkpj)
For the moment I would like to allow this deletion - later we may allow it only for users with specific permissions.
We had this kind of behaviour already for the attachments of those actions, so the solution for this here should be similar to !207 (merged)