X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7f0caf88dd3aac2e4d5bb4ee064137e03ecd4f03..ae60b2a3949e96357477cc04f90fd0873cee8a92:/apps/funding/management/commands/funding_notify.py diff --git a/apps/funding/management/commands/funding_notify.py b/apps/funding/management/commands/funding_notify.py deleted file mode 100755 index a583b2785..000000000 --- a/apps/funding/management/commands/funding_notify.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from optparse import make_option -from django.core.management.base import BaseCommand - - -class Command(BaseCommand): - option_list = BaseCommand.option_list + ( - make_option('-q', '--quiet', action='store_false', dest='verbose', default=True, - help='Suppress output'), - ) - help = 'Sends relevant funding notifications.' - - def handle(self, **options): - - from datetime import date, timedelta - from funding.models import Offer - from funding import app_settings - - verbose = options['verbose'] - - for offer in Offer.past().filter(notified_end=None): - if verbose: - print 'Notify end:', offer - offer.notify_end() - - current = Offer.current() - if (current is not None and - current.end <= date.today() + timedelta(app_settings.DAYS_NEAR - 1) and - not current.notified_near): - if verbose: - print 'Notify near:', current - current.notify_near()