From e2d2665edf6e3aaee49cfb76fd61afcad2f06a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 15 Jan 2019 21:36:01 +0200 Subject: [PATCH] Prepare for the removal of Check.user_id --- hc/accounts/models.py | 6 +++--- templates/emails/summary-html.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hc/accounts/models.py b/hc/accounts/models.py index e76dd658..6fc987aa 100644 --- a/hc/accounts/models.py +++ b/hc/accounts/models.py @@ -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) diff --git a/templates/emails/summary-html.html b/templates/emails/summary-html.html index 3218186c..2172541d 100644 --- a/templates/emails/summary-html.html +++ b/templates/emails/summary-html.html @@ -1,10 +1,10 @@ {% load humanize hc_extras %} -{% regroup checks by user as groups %} +{% regroup checks by project as groups %} {% for group in groups %}
- {{ group.grouper.profile|mangle_link }} + {{ group.grouper|mangle_link }} Last Ping