Ada Young committed 348c6b5

Missing db.commit() .. (^_^')

Comments (0)

Files changed (1)

             n_results = cursor.fetchall()
             if not len(n_results) > 0: # here we prune results to avoid duplicates
                 import_set.append((newsid, author, recipient, subject, timestamp, f_content, orgid))
         INSERT INTO org_news (newsid, author, recipient, subject, timestamp, f_content, orgid) VALUES (?, ?, ?, ?, datetime(?), ?, ?)
         """, import_set) # this line makes the inserts go super fast
-        try:
-            # If I don't do this the db is left in a locked state for some reason, it gives an error anyway thus the try block
-            cursor.execute("END")
-        except:
-            pass
+        db.commit()
         Note("NewsDB: Imported a total of %d new objects." % len(import_set))
     except sqlite3.Error as e:
         Note("SQLite error: {0}".format(e.message))
         Note("NewsDB: Invalid file or the file does not contain a NewsDB pickle object.")