X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..907aba88951334676a259dccc8f7edd8934d5e00:/src/club/helpers.py 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()