diff --git a/flashcards/management/commands/notifyusers.py b/flashcards/management/commands/notifyusers.py index 26ca296..7d8c436 100644 --- a/flashcards/management/commands/notifyusers.py +++ b/flashcards/management/commands/notifyusers.py @@ -8,7 +8,7 @@ class Command(BaseCommand): help = 'Notify the users if they have cards to be reviewed' def handle(self, *args, **options): - notify_list = UserFlashcard.objects.filter( + notify_list = UserFlashcard.objects.prefetch_related('user').filter( next_review__lte=Now() ).exclude( user__registration_id=None,