diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index fd0beaa22f1cb92b18d04e8d99d38bcf5b8e6dd8..e3dd04889a2ce16a28307a0e4ea870907511c446 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -661,6 +661,12 @@ one with the entities that need to be updated and the other with entities to be "use for example the Scanner to create this data.")) crawled_data = self.crawled_data + if isinstance(path_for_authorized_run, list) and self.securityMode != SecurityMode.UPDATE: + raise NotImplementedError( + "Authorization of inserts and updates is currently implemented only " + "for single paths, not for lists of paths." + ) + to_be_inserted, to_be_updated = self._split_into_inserts_and_updates( SyncGraph(crawled_data, self.identifiableAdapter)) @@ -718,21 +724,11 @@ one with the entities that need to be updated and the other with entities to be update_cache = UpdateCache() pending_inserts = update_cache.get_inserts(self.run_id) if pending_inserts: - if isinstance(path_for_authorized_run, list): - raise NotImplementedError( - "Authorization of inserts is currently implemented only for single paths, " - "not for lists of paths." - ) Crawler.inform_about_pending_changes( pending_inserts, self.run_id, path_for_authorized_run) pending_updates = update_cache.get_updates(self.run_id) if pending_updates: - if isinstance(path_for_authorized_run, list): - raise NotImplementedError( - "Authorization of updates is currently implemented only for single paths, " - "not for lists of paths." - ) Crawler.inform_about_pending_changes( pending_updates, self.run_id, path_for_authorized_run)