diff --git a/src/Model/HydraulicStructures/HydraulicStructures.py b/src/Model/HydraulicStructures/HydraulicStructures.py index 78543a61..5d9a7472 100644 --- a/src/Model/HydraulicStructures/HydraulicStructures.py +++ b/src/Model/HydraulicStructures/HydraulicStructures.py @@ -118,8 +118,8 @@ class HydraulicStructure(SQLSubModel): ) hs.enabled = enabled - hs.input_kp = input_kp - hs.output_kp = output_kp + hs.input_kp = input_kp if input_kp != -1 else None + hs.output_kp = output_kp if output_kp != -1 else None hs.input_reach, hs.output_reach = reduce( lambda acc, n: ( diff --git a/src/View/HydraulicStructures/Table.py b/src/View/HydraulicStructures/Table.py index 58e08684..210cf1e8 100644 --- a/src/View/HydraulicStructures/Table.py +++ b/src/View/HydraulicStructures/Table.py @@ -80,7 +80,7 @@ class ComboBoxDelegate(QItemDelegate): val ) - self.editor.setCurrentText(index.data(Qt.DisplayRole)) + self.editor.setCurrentText(str(index.data(Qt.DisplayRole))) return self.editor def setEditorData(self, editor, index):