Skip to content

Commit

Permalink
Ignore deleted files on contetndb iteritems
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Sep 9, 2016
1 parent 7d78623 commit e3de6da
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Content/ContentDbDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ def __delitem__(self, key):
self.db.deleteContent(self.site_address, key)

def iteritems(self):
for key, val in dict.iteritems(self):
if not val:
val = self.loadItem(key)
for key in dict.keys(self):
try:
val = self[key]
except Exception, err:
self.log.error("Error loading %s: %s" % (key, err))
continue
yield key, val

def items(self):
Expand All @@ -83,6 +86,7 @@ def items(self):
try:
val = self.loadItem(key)
except Exception:
self.log.error("Error loading %s: %s" % (key, err))
continue
back.append((key, val))
return back
Expand Down

0 comments on commit e3de6da

Please sign in to comment.