diff options
Diffstat (limited to 'servo/management')
-rwxr-xr-x | servo/management/commands/cron.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/servo/management/commands/cron.py b/servo/management/commands/cron.py index e2831e9..519cbb4 100755 --- a/servo/management/commands/cron.py +++ b/servo/management/commands/cron.py @@ -92,9 +92,8 @@ class Command(BaseCommand): now = timezone.now() limit = now - timedelta(days=1) - locations = Location.objects.filter(site_id=settings.SITE_ID) - for l in locations: + for l in Location.objects.filter(enabled=True): table = CsvTable() table.addheader(['Order', 'Assigned To', 'Status', 'Days red']) @@ -126,9 +125,7 @@ class Command(BaseCommand): except KeyError: raise ValueError('Default sender address not defined') - locations = Location.objects.filter(site_id=settings.SITE_ID) - - for l in locations: + for l in Location.objects.filter(enabled=True): out_of_stock = Inventory.objects.filter( location=l, amount_stocked__lt=F('amount_minimum') |