Browse Source

Cleanup in report-body-html.html.

Add a "Send Nag" admin command for easier testing.
pull/287/head
Pēteris Caune 5 years ago
parent
commit
93507fcc47
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 19 additions and 16 deletions
  1. +7
    -1
      hc/accounts/admin.py
  2. +12
    -15
      templates/emails/report-body-html.html

+ 7
- 1
hc/accounts/admin.py View File

@ -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)

+ 12
- 15
templates/emails/report-body-html.html View File

@ -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…
Cancel
Save