]> git.ozlabs.org Git - patchwork/commitdiff
management: Resolve bugs with 'cron' command
authorStephen Finucane <stephen.finucane@intel.com>
Fri, 21 Aug 2015 14:32:15 +0000 (15:32 +0100)
committerDamien Lespiau <damien.lespiau@intel.com>
Thu, 17 Sep 2015 16:52:29 +0000 (17:52 +0100)
Resolve two bugs with the script:

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

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
patchwork/management/commands/cron.py

index 6217e758d6bf90b72e99aa72f1b59dc38e67584d..308b4b26ea7b6229d1de3fad510b19053f9a8323 100755 (executable)
@@ -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))
-