forked from GithubBackups/healthchecks
Cleanup in report-body-html.html.
Add a "Send Nag" admin command for easier testing.
This commit is contained in:
parent
339ac5e9d9
commit
93507fcc47
@ -189,7 +189,7 @@ class ProjectAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
|
|
||||||
class HcUserAdmin(UserAdmin):
|
class HcUserAdmin(UserAdmin):
|
||||||
actions = ["send_report"]
|
actions = ["send_report", "send_nag"]
|
||||||
list_display = (
|
list_display = (
|
||||||
"id",
|
"id",
|
||||||
"email",
|
"email",
|
||||||
@ -237,6 +237,12 @@ class HcUserAdmin(UserAdmin):
|
|||||||
|
|
||||||
self.message_user(request, "%d email(s) sent" % qs.count())
|
self.message_user(request, "%d email(s) sent" % qs.count())
|
||||||
|
|
||||||
|
def send_nag(self, request, qs):
|
||||||
|
for user in qs:
|
||||||
|
user.profile.send_report(nag=True)
|
||||||
|
|
||||||
|
self.message_user(request, "%d email(s) sent" % qs.count())
|
||||||
|
|
||||||
|
|
||||||
admin.site.unregister(User)
|
admin.site.unregister(User)
|
||||||
admin.site.register(User, HcUserAdmin)
|
admin.site.register(User, HcUserAdmin)
|
||||||
|
@ -15,35 +15,32 @@ Hello,<br />
|
|||||||
{% else %}
|
{% else %}
|
||||||
{{ num_down }} checks are currently <strong>DOWN</strong>.
|
{{ num_down }} checks are currently <strong>DOWN</strong>.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
This is a monthly report sent by <a href="{% site_root %}">{% site_name %}</a>.
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
{% if nag %}
|
|
||||||
{% include "emails/summary-html.html" %}
|
{% include "emails/summary-html.html" %}
|
||||||
{% else %}
|
|
||||||
{% include "emails/summary-downtimes-html.html" %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if nag %}
|
|
||||||
<strong>Too many notifications?</strong>
|
<strong>Too many notifications?</strong>
|
||||||
Visit the <a href="{{ notifications_url }}">Email Reports</a>
|
Visit the <a href="{{ notifications_url }}">Email Reports</a>
|
||||||
page on {% site_name %} to set your notification preferences.
|
page on {% site_name %} to set your notification preferences.
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<strong>Just one more thing to check:</strong>
|
This is a monthly report sent by <a href="{% site_root %}">{% site_name %}</a>.
|
||||||
Do you have more cron jobs,
|
|
||||||
not yet on this list, that would benefit from monitoring?
|
<br />
|
||||||
Get the ball rolling by adding one more!
|
{% include "emails/summary-downtimes-html.html" %}
|
||||||
|
|
||||||
|
<strong>Just one more thing to check:</strong>
|
||||||
|
Do you have more cron jobs,
|
||||||
|
not yet on this list, that would benefit from monitoring?
|
||||||
|
Get the ball rolling by adding one more!
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
Cheers,<br>
|
Cheers,<br>
|
||||||
The {% site_name %} Team
|
The {% site_name %} Team
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block unsub %}
|
{% block unsub %}
|
||||||
<br>
|
<br>
|
||||||
<a href="{{ unsub_link }}?ask=1" target="_blank" style="color: #666666; text-decoration: underline;">
|
<a href="{{ unsub_link }}?ask=1" target="_blank" style="color: #666666; text-decoration: underline;">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user