diff options
Diffstat (limited to 'management')
| -rw-r--r-- | management/commands/sendmails.py | 7 | 
1 files changed, 2 insertions, 5 deletions
diff --git a/management/commands/sendmails.py b/management/commands/sendmails.py index a134d80..b700990 100644 --- a/management/commands/sendmails.py +++ b/management/commands/sendmails.py @@ -5,7 +5,7 @@ from django.template import Context, loader  from django.conf import settings  from edt.models import Group, Subscription, Course -from edt.utils import get_week, group_courses +from edt.utils import get_current_or_next_week, get_week, group_courses  import datetime @@ -16,10 +16,7 @@ class Command(BaseCommand):      def handle(self, *args, **options):          translation.activate(settings.LANGUAGE_CODE) -        year, week, day = timezone.now().isocalendar() -        if day >= 6: -            year, week, _ = (timezone.now() + datetime.timedelta(weeks=1)).isocalendar() - +        year, week = get_current_or_next_week()          start, end = get_week(year, week)          subscriptions = Subscription.objects.filter(active=True)  | 
