forked from GithubBackups/healthchecks
Improve wording
This commit is contained in:
parent
fa5dd8b45a
commit
6094bca241
@ -29,7 +29,7 @@ class Command(BaseCommand):
|
|||||||
help="Keep running indefinitely in a 300 second wait loop",
|
help="Keep running indefinitely in a 300 second wait loop",
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle_one_monthly_report(self):
|
def handle_one_report(self):
|
||||||
report_due = Q(next_report_date__lt=timezone.now())
|
report_due = Q(next_report_date__lt=timezone.now())
|
||||||
report_not_scheduled = Q(next_report_date__isnull=True)
|
report_not_scheduled = Q(next_report_date__isnull=True)
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class Command(BaseCommand):
|
|||||||
self.stdout.write("sendreports is now running")
|
self.stdout.write("sendreports is now running")
|
||||||
while True:
|
while True:
|
||||||
# Monthly reports
|
# Monthly reports
|
||||||
while self.handle_one_monthly_report():
|
while self.handle_one_report():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Daily and hourly nags
|
# Daily and hourly nags
|
||||||
|
@ -37,7 +37,7 @@ class SendReportsTestCase(BaseTestCase):
|
|||||||
cmd = Command(stdout=Mock())
|
cmd = Command(stdout=Mock())
|
||||||
cmd.pause = Mock() # don't pause for 1s
|
cmd.pause = Mock() # don't pause for 1s
|
||||||
|
|
||||||
found = cmd.handle_one_monthly_report()
|
found = cmd.handle_one_report()
|
||||||
self.assertTrue(found)
|
self.assertTrue(found)
|
||||||
|
|
||||||
self.profile.refresh_from_db()
|
self.profile.refresh_from_db()
|
||||||
@ -53,14 +53,14 @@ class SendReportsTestCase(BaseTestCase):
|
|||||||
self.profile.next_report_date = now() + td(days=1)
|
self.profile.next_report_date = now() + td(days=1)
|
||||||
self.profile.save()
|
self.profile.save()
|
||||||
|
|
||||||
found = Command().handle_one_monthly_report()
|
found = Command().handle_one_report()
|
||||||
self.assertFalse(found)
|
self.assertFalse(found)
|
||||||
|
|
||||||
def test_it_fills_blank_next_report_date(self):
|
def test_it_fills_blank_next_report_date(self):
|
||||||
self.profile.next_report_date = None
|
self.profile.next_report_date = None
|
||||||
self.profile.save()
|
self.profile.save()
|
||||||
|
|
||||||
found = Command().handle_one_monthly_report()
|
found = Command().handle_one_report()
|
||||||
self.assertTrue(found)
|
self.assertTrue(found)
|
||||||
|
|
||||||
self.profile.refresh_from_db()
|
self.profile.refresh_from_db()
|
||||||
@ -72,13 +72,13 @@ class SendReportsTestCase(BaseTestCase):
|
|||||||
self.profile.reports = "off"
|
self.profile.reports = "off"
|
||||||
self.profile.save()
|
self.profile.save()
|
||||||
|
|
||||||
found = Command().handle_one_monthly_report()
|
found = Command().handle_one_report()
|
||||||
self.assertFalse(found)
|
self.assertFalse(found)
|
||||||
|
|
||||||
def test_it_requires_pinged_checks(self):
|
def test_it_requires_pinged_checks(self):
|
||||||
self.check.delete()
|
self.check.delete()
|
||||||
|
|
||||||
found = Command().handle_one_monthly_report()
|
found = Command().handle_one_report()
|
||||||
self.assertTrue(found)
|
self.assertTrue(found)
|
||||||
|
|
||||||
# No email should have been sent:
|
# No email should have been sent:
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<input id="tz" type="hidden" name="tz" value="{{ profile.tz }}" />
|
<input id="tz" type="hidden" name="tz" value="{{ profile.tz }}" />
|
||||||
|
|
||||||
<p>Send me periodic email reports:</p>
|
<p>Periodic email reports:</p>
|
||||||
<label class="radio-container">
|
<label class="radio-container">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
@ -41,7 +41,7 @@
|
|||||||
value="off"
|
value="off"
|
||||||
{% if profile.reports == "off" %} checked {% endif %}>
|
{% if profile.reports == "off" %} checked {% endif %}>
|
||||||
<span class="radiomark"></span>
|
<span class="radiomark"></span>
|
||||||
Do not send me email reports
|
Off
|
||||||
</label>
|
</label>
|
||||||
<label class="radio-container">
|
<label class="radio-container">
|
||||||
<input
|
<input
|
||||||
@ -50,7 +50,7 @@
|
|||||||
value="weekly"
|
value="weekly"
|
||||||
{% if profile.reports == "weekly" %} checked {% endif %}>
|
{% if profile.reports == "weekly" %} checked {% endif %}>
|
||||||
<span class="radiomark"></span>
|
<span class="radiomark"></span>
|
||||||
Weekly on Mondays
|
<strong>Weekly</strong> on Mondays
|
||||||
</label>
|
</label>
|
||||||
<label class="radio-container">
|
<label class="radio-container">
|
||||||
<input
|
<input
|
||||||
@ -59,11 +59,11 @@
|
|||||||
value="monthly"
|
value="monthly"
|
||||||
{% if profile.reports == "monthly" %} checked {% endif %}>
|
{% if profile.reports == "monthly" %} checked {% endif %}>
|
||||||
<span class="radiomark"></span>
|
<span class="radiomark"></span>
|
||||||
Monthly on 1st of every month
|
<strong>Monthly</strong> on 1st of every month
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<p>If any checks are down:</p>
|
<p>Ongoing reminders if any checks are down:</p>
|
||||||
|
|
||||||
<label class="radio-container">
|
<label class="radio-container">
|
||||||
<input
|
<input
|
||||||
@ -81,7 +81,7 @@
|
|||||||
value="86400"
|
value="86400"
|
||||||
{% if profile.nag_period.total_seconds == 86400 %} checked {% endif %}>
|
{% if profile.nag_period.total_seconds == 86400 %} checked {% endif %}>
|
||||||
<span class="radiomark"></span>
|
<span class="radiomark"></span>
|
||||||
Remind me daily
|
Remind me <strong>daily</strong>
|
||||||
</label>
|
</label>
|
||||||
<label class="radio-container">
|
<label class="radio-container">
|
||||||
<input
|
<input
|
||||||
@ -90,7 +90,7 @@
|
|||||||
value="3600"
|
value="3600"
|
||||||
{% if profile.nag_period.total_seconds == 3600 %} checked {% endif %}>
|
{% if profile.nag_period.total_seconds == 3600 %} checked {% endif %}>
|
||||||
<span class="radiomark"></span>
|
<span class="radiomark"></span>
|
||||||
Remind me hourly
|
Remind me <strong>hourly</strong>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user