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):
|
||||
actions = ["send_report"]
|
||||
actions = ["send_report", "send_nag"]
|
||||
list_display = (
|
||||
"id",
|
||||
"email",
|
||||
@ -237,6 +237,12 @@ class HcUserAdmin(UserAdmin):
|
||||
|
||||
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.register(User, HcUserAdmin)
|
||||
|
@ -15,35 +15,32 @@ Hello,<br />
|
||||
{% else %}
|
||||
{{ num_down }} checks are currently <strong>DOWN</strong>.
|
||||
{% endif %}
|
||||
{% else %}
|
||||
This is a monthly report sent by <a href="{% site_root %}">{% site_name %}</a>.
|
||||
{% endif %}
|
||||
|
||||
<br />
|
||||
|
||||
{% if nag %}
|
||||
<br />
|
||||
{% include "emails/summary-html.html" %}
|
||||
{% else %}
|
||||
{% include "emails/summary-downtimes-html.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if nag %}
|
||||
<strong>Too many notifications?</strong>
|
||||
Visit the <a href="{{ notifications_url }}">Email Reports</a>
|
||||
page on {% site_name %} to set your notification preferences.
|
||||
|
||||
{% else %}
|
||||
<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!
|
||||
This is a monthly report sent by <a href="{% site_root %}">{% site_name %}</a>.
|
||||
|
||||
<br />
|
||||
{% 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 %}
|
||||
|
||||
<br /><br />
|
||||
|
||||
Cheers,<br>
|
||||
The {% site_name %} Team
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block unsub %}
|
||||
<br>
|
||||
<a href="{{ unsub_link }}?ask=1" target="_blank" style="color: #666666; text-decoration: underline;">
|
||||
|
Loading…
x
Reference in New Issue
Block a user