4ece5f9ab3f0f1a2e8d053cc68622e16e9a0137d
[wolnelektury.git] / src / club / helpers.py
1 from django.utils.timezone import now
2 from .models import Schedule
3
4
5 def get_active_schedule(user):
6     if not user.is_authenticated:
7         return None
8     return Schedule.objects.filter(membership__user=user, expires_at__gt=now()).first()
9