Skip to content

Commit

Permalink
Only send recap email if there are errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jul 5, 2023
1 parent 5f0b6b3 commit 4605a6c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/management/commands/detect_broken_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@


class Command(BaseCommand):
"""
Usage:
python manage.py detect_broken_links
"""

def handle(self, *args, **options):
print("=== detect_broken_links running")

Expand All @@ -27,7 +32,9 @@ def handle(self, *args, **options):
quiz_error_list = self.detect_quiz_broken_links()
error_list.extend(quiz_error_list)

self.send_recap_email(error_list)
# only send recap email if there are errors
if len(error_list):
self.send_recap_email(error_list)

def detect_question_broken_links(self):
error_list = list()
Expand Down

0 comments on commit 4605a6c

Please sign in to comment.