]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/bin/patchwork-cron.py
notifications: Add code to send notifications
[patchwork] / apps / patchwork / bin / patchwork-cron.py
diff --git a/apps/patchwork/bin/patchwork-cron.py b/apps/patchwork/bin/patchwork-cron.py
new file mode 100755 (executable)
index 0000000..e9bd0c1
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+import sys
+from patchwork.utils import send_notifications
+
+def main(args):
+    errors = send_notifications()
+    for (recipient, error) in errors:
+        print "Failed sending to %s: %s" % (recipient.email, ex)
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
+