X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..ecd1f5bc214a8ba61b65d4d00a7e7d09a8c8fa3a:/src/club/helpers.py?ds=sidebyside diff --git a/src/club/helpers.py b/src/club/helpers.py index b4ef0dd7d..9bcf6dfe2 100644 --- a/src/club/helpers.py +++ b/src/club/helpers.py @@ -8,5 +8,7 @@ from .models import Schedule def get_active_schedule(user): if not user.is_authenticated: return None - return Schedule.objects.filter(membership__user=user, expires_at__gt=now()).first() + return Schedule.objects.filter( + membership__user=user + ).exclude(payed_at=None).exclude(expires_at__lt=now()).first()