]> git.ozlabs.org Git - patchwork/blob - patchwork/management/commands/cron.py
7c00ea36d72018e2e1dae69f918e83adf03c26d6
[patchwork] / patchwork / management / commands / cron.py
1 from django.core.management.base import BaseCommand
2 from patchwork.utils import send_notifications, do_expiry
3
4
5 class Command(BaseCommand):
6     help = ('Run periodic patchwork functions: send notifications and '
7             'expire unused users')
8
9     def handle(self, *args, **kwargs):
10         errors = send_notifications()
11         for (recipient, error) in errors:
12             self.stderr.write("Failed sending to %s: %s" %
13                               (recipient.email, error))
14
15         do_expiry()