X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..0b270a76ad73162f894285c360a0ee87fa84e536:/src/club/management/commands/prolong.py diff --git a/src/club/management/commands/prolong.py b/src/club/management/commands/prolong.py index 3c8b36cb1..faa4518e5 100644 --- a/src/club/management/commands/prolong.py +++ b/src/club/management/commands/prolong.py @@ -1,7 +1,8 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from datetime import timedelta +import traceback from django.core.management.base import BaseCommand, CommandError from django.utils.timezone import now from club.models import Schedule @@ -9,7 +10,11 @@ from club.models import Schedule class Command(BaseCommand): def handle(self, *args, **options): - for s in Schedule.objects.filter(is_cancelled=False, expires_at__lt=now() + timedelta(1)): + for s in Schedule.objects.exclude(monthly=False, yearly=False).filter(is_cancelled=False, expires_at__lt=now() + timedelta(1)): print(s, s.email, s.expires_at) - s.pay(None) + try: + s.pay(None) + except: + traceback.print_exc() +