Skip to content

Instantly share code, notes, and snippets.

@nop33
Created April 29, 2016 10:02
Show Gist options
  • Save nop33/a1db11d0a553ca52adb56e97b00b123f to your computer and use it in GitHub Desktop.
Save nop33/a1db11d0a553ca52adb56e97b00b123f to your computer and use it in GitHub Desktop.
Slays zombi events in a category
from BTrees.OOBTree import OOTreeSet
cat = CategoryManager().getById(5052)
new_conferences = OOTreeSet()
for conf in cat.conferences:
if not EE(conf.getId()).is_deleted:
new_conferences.insert(conf)
else:
cat.unindexConf(conf)
cat.conferences = new_conferences
cat._numConferences = len(new_conferences)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment