From 8cb3928531ae09e822f530fd8f453b32ee51121a Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 9 Mar 2016 16:54:52 +0100 Subject: [PATCH] Utility to subscribe node owners to notifications --- pillar/manage.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pillar/manage.py b/pillar/manage.py index 7454f87f..83684279 100644 --- a/pillar/manage.py +++ b/pillar/manage.py @@ -581,5 +581,17 @@ def files_make_public_t(): except Exception: pass +@manager.command +def subscribe_node_owners(): + """Automatically subscribe node owners to notifications for items created + in the past. + """ + from application import after_inserting_nodes + nodes_collection = app.data.driver.db['nodes'] + for n in nodes_collection.find(): + if 'parent' in n: + after_inserting_nodes([n]) + + if __name__ == '__main__': manager.run()