X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..79e9ae3a7f85ac383306a5840250343597024a0b:/src/club/helpers.py?ds=inline 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()