Fix statement execution
authorKarl Pinc <kop@karlpinc.com>
Mon, 5 Aug 2024 05:05:03 +0000 (01:05 -0400)
committerKarl Pinc <kop@karlpinc.com>
Mon, 5 Aug 2024 05:05:03 +0000 (01:05 -0400)
Does this handle encoding errors?  If not, call self.param_execute()
and change the function to take a tuple, not a UploadDataLine instance.

src/pgwui_upcen/views/upcen.py

index d71e553539ed1c215939ae5845068d03c6b8ae7d..b186b25ebbf77186e5643a4a4095ea0c8d1671a1 100644 (file)
@@ -61,7 +61,7 @@ class SaveUCLine(pgwui_core.core.DataLineProcessor,
 
     def get_sname(self, udl):
         sname = udl.tuples[0].strip()
-        self.execute(SNAME_EXISTS_QUERY, (sname,))
+        self.uh.execute(SNAME_EXISTS_QUERY, (sname,))
         if self.cur.fetchone() is None:
             raise upcen_ex.UnknownSnameError(
                 udl.lineno,
@@ -118,7 +118,7 @@ class SaveUCLine(pgwui_core.core.DataLineProcessor,
                 except upcen_ex.UnknownStatusCode as err:
                     errors.append(err)
                 else:
-                    self.param_execute(
+                    self.uh.execute(
                         INSERT_STMT, (sname, date, self.group, status))
             col -= 1