From 7676f6921684189f5287210365382541b28d7069 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Thu, 8 Apr 2021 17:33:16 +0200
Subject: [PATCH] Fix note list when daily reports are sent

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 management/commands/send_reports.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/management/commands/send_reports.py b/management/commands/send_reports.py
index c1dae04..8112aeb 100644
--- a/management/commands/send_reports.py
+++ b/management/commands/send_reports.py
@@ -20,8 +20,8 @@ class Command(BaseCommand):
 
     def handle(self, *args, **options):
         activate('fr')
-        if "notes" in options:
-            notes = NoteUser.objects.filter(pk__in=options["notes"]).all()
+        if 'notes' in options and options['notes']:
+            notes = NoteUser.objects.filter(pk__in=options['notes']).all()
         else:
             notes = NoteUser.objects.filter(
                 user__memberships__date_end__gte=timezone.now(),
-- 
GitLab