git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c278ffe
)
when removing a site make sure to remove all records at the site
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 28 Dec 2009 15:52:31 +0000
(15:52 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Mon, 28 Dec 2009 15:52:31 +0000
(15:52 +0000)
sfa/util/genitable.py
patch
|
blob
|
history
diff --git
a/sfa/util/genitable.py
b/sfa/util/genitable.py
index
80a4dda
..
bf436bc
100644
(file)
--- a/
sfa/util/genitable.py
+++ b/
sfa/util/genitable.py
@@
-92,8
+92,16
@@
class GeniTable(list):
self.cnx.query(index)
def remove(self, record):
self.cnx.query(index)
def remove(self, record):
- query_str = "DELETE FROM %s WHERE record_id = %s" % (self.tablename, record['record_id'])
+ query_str = "DELETE FROM %s WHERE record_id = %s" % \
+ (self.tablename, record['record_id'])
self.cnx.query(query_str)
self.cnx.query(query_str)
+
+ # if this is a site, remove all records where 'authority' == the
+ # site's hrn
+ if record['type'] == 'site':
+ sql = " DELETE FROM %s WHERE authority = %s" % \
+ (self.tablename, record['hrn'])
+ self.cnx.query(sql)
def insert(self, record):
db_fields = self.db_fields(record)
def insert(self, record):
db_fields = self.db_fields(record)