Browse Source

Prepare for the removal of Check.user_id

pull/214/head
Pēteris Caune 6 years ago
parent
commit
e2d2665edf
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      hc/accounts/models.py
  2. +2
    -2
      templates/emails/summary-html.html

+ 3
- 3
hc/accounts/models.py View File

@ -156,10 +156,10 @@ class Profile(models.Model):
if nag and num_down == 0:
return False
# Sort checks by owner. Need this because will group by owner in
# Sort checks by project. Need this because will group by project in
# template.
checks = checks.select_related("user", "user__profile")
checks = checks.order_by("user_id")
checks = checks.select_related("project")
checks = checks.order_by("project_id")
# list() executes the query, to avoid DB access while
# rendering the template
checks = list(checks)


+ 2
- 2
templates/emails/summary-html.html View File

@ -1,10 +1,10 @@
{% load humanize hc_extras %}
{% regroup checks by user as groups %}
{% regroup checks by project as groups %}
<table style="margin: 0; width: 100%; font-size: 16px;" cellpadding="0" cellspacing="0">
{% for group in groups %}
<tr>
<td colspan="2" style="font-weight: bold; padding: 32px 8px 8px 8px; color: #333;">
{{ group.grouper.profile|mangle_link }}
{{ group.grouper|mangle_link }}
</td>
<td style="padding: 32px 8px 8px 8px; margin: 0; font-size: 12px; color: #9BA2AB; font-family: Helvetica, Arial, sans-serif;">Last Ping</td>
</tr>


Loading…
Cancel
Save