From a144bc762d8ceba05cb2edd3cfbbf3af5fd9a198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 22 Jan 2019 10:53:44 +0200 Subject: [PATCH] Fix the team member list in Account Settings > Team Access --- hc/accounts/models.py | 3 +++ templates/accounts/profile.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hc/accounts/models.py b/hc/accounts/models.py index baa7b323..0590cabc 100644 --- a/hc/accounts/models.py +++ b/hc/accounts/models.py @@ -213,6 +213,9 @@ class Profile(models.Model): def member_count(self): return Member.objects.filter(project__owner__profile=self).count() + def members(self): + return Member.objects.filter(project__owner__profile=self).all() + class Project(models.Model): code = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) diff --git a/templates/accounts/profile.html b/templates/accounts/profile.html index 08fb85e4..824c50c0 100644 --- a/templates/accounts/profile.html +++ b/templates/accounts/profile.html @@ -118,14 +118,14 @@

Team Access

- {% if profile.member_set.count %} + {% if profile.member_count %} - {% for member in profile.member_set.all %} + {% for member in profile.members %}
{{ profile.user.email }} Owner
{{ member.user.email }} Member