From 3606016b51fdc4e13e867209310d8cbb3a8e6435 Mon Sep 17 00:00:00 2001
From: kienle <kienle@passcal.nmt.edu>
Date: Tue, 7 Jan 2025 09:58:18 -0700
Subject: [PATCH] FIx reset row to backup db not working

In Channels editor, modifications to the last column before the action
buttons are not detected. As a result, the "Reset to org. db" buttons
are not active for these changes.
---
 sohstationviewer/view/db_config/channel_dialog.py   | 2 +-
 sohstationviewer/view/db_config/db_config_dialog.py | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/sohstationviewer/view/db_config/channel_dialog.py b/sohstationviewer/view/db_config/channel_dialog.py
index e58eb1d9..be76875f 100755
--- a/sohstationviewer/view/db_config/channel_dialog.py
+++ b/sohstationviewer/view/db_config/channel_dialog.py
@@ -162,7 +162,7 @@ class ChannelDialog(UiDBInfoDialog):
             str(row_content[3]))
         self.data_table_widget.cellWidget(row_idx, 5).setText(row_content[4])
         self.data_table_widget.cellWidget(row_idx, 6).setValue(row_content[5])
-        self.data_table_widget.cellWidget(row_idx, 7).set_checked(row_content[6])
+        self.data_table_widget.cellWidget(row_idx, 7).setChecked(row_content[6])
 
     def set_row_widgets(self, row_idx, fk=False):
         """
diff --git a/sohstationviewer/view/db_config/db_config_dialog.py b/sohstationviewer/view/db_config/db_config_dialog.py
index 32aedbdc..22ebf089 100755
--- a/sohstationviewer/view/db_config/db_config_dialog.py
+++ b/sohstationviewer/view/db_config/db_config_dialog.py
@@ -635,10 +635,6 @@ class UiDBInfoDialog(OneWindowAtATimeDialog):
             # Primary key is always the first item in a row
             backup_rows = [r for r in self.backup_database_rows
                            if r[0] == curr_row[0]]
-            if self.need_data_type_choice:
-                # data type is one of primary keys
-                backup_rows = [r for r in backup_rows
-                               if r[-1] == curr_row[-1]]
             if backup_rows:
                 # reset function available when there's backup row
                 backup_row = backup_rows[0]
-- 
GitLab