From: Tony Mack Date: Mon, 12 Apr 2010 21:50:11 +0000 (+0000) Subject: dont forget to commit the transaction in remove() and create() X-Git-Tag: sfa-0.9-11~6^2~33 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=392cfb8c7cc88f8b92959bdf00139487ae03f0de dont forget to commit the transaction in remove() and create() --- diff --git a/sfa/util/table.py b/sfa/util/table.py index bccda20d..0b78740a 100644 --- a/sfa/util/table.py +++ b/sfa/util/table.py @@ -84,7 +84,9 @@ class SfaTable(list): self.db.do(querystr) for index in indexes: self.db.do(index) - + + sefl.db.commit() + def remove(self, record): query_str = "DELETE FROM %s WHERE record_id = %s" % \ (self.tablename, record['record_id']) @@ -92,10 +94,11 @@ class SfaTable(list): # if this is a site, remove all records where 'authority' == the # site's hrn - if record['type'] == 'site': + if record['type'] == 'authority': sql = " DELETE FROM %s WHERE authority = %s" % \ (self.tablename, record['hrn']) - self.db.do(sql) + self.db.do(sql) + self.db.commit() def insert(self, record): db_fields = self.db_fields(record)