[PATCH v2 11/16] management: Resolve bugs with 'cron' command

Stephen Finucane stephen.finucane at intel.com
Sat Aug 22 00:32:15 AEST 2015


Resolve two bugs with the script:

- There's no 'main' function to call
- A variable is misnamed

Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/management/commands/cron.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/patchwork/management/commands/cron.py b/patchwork/management/commands/cron.py
index 6217e75..308b4b2 100755
--- a/patchwork/management/commands/cron.py
+++ b/patchwork/management/commands/cron.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 from django.core.management.base import BaseCommand, CommandError
 from patchwork.utils import send_notifications, do_expiry
 
@@ -11,10 +9,6 @@ class Command(BaseCommand):
         errors = send_notifications()
         for (recipient, error) in errors:
             self.stderr.write("Failed sending to %s: %s" %
-                                (recipient.email, ex))
+                                (recipient.email, error))
 
         do_expiry()
-
-if __name__ == '__main__':
-    sys.exit(main(sys.argv))
-
-- 
2.0.0



More information about the Patchwork mailing list