From 014ab7a6b802cf7ea411fef99f84d13dc7ac7219 Mon Sep 17 00:00:00 2001 From: Egor Matveev Date: Sun, 19 Dec 2021 18:53:16 +0300 Subject: [PATCH] verified --- Main/models/userinfo.py | 2 +- templates/account.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Main/models/userinfo.py b/Main/models/userinfo.py index 25a8637..7336160 100644 --- a/Main/models/userinfo.py +++ b/Main/models/userinfo.py @@ -35,7 +35,7 @@ class UserInfo(models.Model): @cached_property def friends(self): - return Friendship.objects.filter(Q(to_user=self.user) | Q(from_user=self.user)) + return Friendship.objects.filter(Q(to_user=self.user) | Q(from_user=self.user)).order_by("verified") @property def favourite_language(self): diff --git a/templates/account.html b/templates/account.html index ef1784e..179d811 100644 --- a/templates/account.html +++ b/templates/account.html @@ -141,7 +141,7 @@

Друзья

{% for friendship in user.userinfo.friends %} - {% if friendship.to_user == user %}{{ friendship.from_user.username }}{% else %}{{ friendship.to_user.username }}{% endif %}
+ {% if friendship.to_user == user %}{{ friendship.from_user.username }}{% else %}{{ friendship.to_user.username }}{% endif %}{% if not friendship.verified %} {% endif %}
{% endfor %}
{% endif %}