Last active
March 17, 2023 14:54
-
-
Save espenmn/cb7e3923e46b145dc7fcb8ee4833c9bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # bin/instance run find_macfiles.py -O skipshistorie | |
| import plone.api | |
| from zope.component.hooks import setSite | |
| setSite(app['skipshistorie']) | |
| for brain in app.skipshistorie.portal_catalog(id="ds_store"): | |
| obj= brain.getObject() | |
| print('deleting') | |
| try: | |
| plone.api.content.delete(obj) | |
| except Exception as e: | |
| print(f"Error deleting object {obj.absolute_url()}: {e}") | |
| import transaction ; | |
| transaction.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment