Implement broken link email handling

This commit is contained in:
Quantum 2022-01-24 20:06:46 -05:00
parent 637069c4e7
commit 35240c990f

View file

@ -51,6 +51,7 @@ class Command(BaseCommand):
link.check_url() link.check_url()
if was_working and not link.is_working: if was_working and not link.is_working:
self.stdout.write(f'URL for {link.short} just broke: {link.long}') self.stdout.write(f'URL for {link.short} just broke: {link.long}')
send_broken_email(link) if settings.QLINKS_BROKEN_EMAIL:
send_broken_email(link)
time.sleep(settings.QLINKS_CHECK_THROTTLE) time.sleep(settings.QLINKS_CHECK_THROTTLE)