From: Stephen Finucane Date: Fri, 21 Aug 2015 14:32:15 +0000 (+0100) Subject: management: Resolve bugs with 'cron' command X-Git-Url: https://git.ozlabs.org/?p=patchwork;a=commitdiff_plain;h=56febdf94df1ea454e49e9e1a8cc4cbc63e42068 management: Resolve bugs with 'cron' command Resolve two bugs with the script: - There's no 'main' function to call - A variable is misnamed Reviewed-by: Damien Lespiau Signed-off-by: Stephen Finucane Signed-off-by: Damien Lespiau --- 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)) -