close_orders.py 441 Bytes
Newer Older
Patrick's avatar
Patrick committed
1 2 3 4 5 6 7 8 9
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from repanier import tasks

class Command(BaseCommand):
    args = '<none>'
    help = 'Closes now orders on due date'

    def handle(self, *args, **options):
Patrick's avatar
Patrick committed
10
		something_to_close = tasks.close_orders_now()
Patrick's avatar
Patrick committed
11 12
		if something_to_close:
			self.stdout.write('At least on order being closed')
Patrick's avatar
Patrick committed
13 14
		else:
			self.stdout.write('Nothing to close')