diff --git a/djangoldp_notification/management/commands/suppress_old_notifications.py b/djangoldp_notification/management/commands/suppress_old_notifications.py index d27011749a4253e2d05a1a82fe49184894fbb91b..6bb6b5b182fd88d94366e717ddaf5565a5f1fcec 100644 --- a/djangoldp_notification/management/commands/suppress_old_notifications.py +++ b/djangoldp_notification/management/commands/suppress_old_notifications.py @@ -1,5 +1,6 @@ from textwrap import dedent from datetime import datetime, timedelta +from django.utils import timezone from django.core.management.base import BaseCommand, CommandError from djangoldp_notification.models import Notification @@ -48,5 +49,5 @@ class Command(BaseCommand): def handle(self, *args, **options): older_than = _compute_time_limit(options["older"]) - limit = datetime.today() - timedelta(minutes=older_than) + limit = timezone.now() - timedelta(minutes=older_than) Notification.objects.filter(date__lte=limit).delete()