Ignore deleted files on contetndb iteritems

This commit is contained in:
shortcutme 2016-09-09 12:24:00 +02:00
parent 7d78623c92
commit e3de6da87e

View file

@ -70,9 +70,12 @@ class ContentDbDict(dict):
self.db.deleteContent(self.site_address, key) self.db.deleteContent(self.site_address, key)
def iteritems(self): def iteritems(self):
for key, val in dict.iteritems(self): for key in dict.keys(self):
if not val: try:
val = self.loadItem(key) val = self[key]
except Exception, err:
self.log.error("Error loading %s: %s" % (key, err))
continue
yield key, val yield key, val
def items(self): def items(self):
@ -83,6 +86,7 @@ class ContentDbDict(dict):
try: try:
val = self.loadItem(key) val = self.loadItem(key)
except Exception: except Exception:
self.log.error("Error loading %s: %s" % (key, err))
continue continue
back.append((key, val)) back.append((key, val))
return back return back