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 %}