This commit is contained in:
Egor Matveev 2021-12-19 18:53:16 +03:00
parent b28490697f
commit 014ab7a6b8
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -141,7 +141,7 @@
<h2 style="margin-bottom: 20px;">Друзья</h2>
<h5>
{% for friendship in user.userinfo.friends %}
<i class="fa fa-user"></i> <a href="/account?username={% 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 %}</a><br>
<i class="fa fa-user"></i> <a href="/account?username={% 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 %}</a>{% if not friendship.verified %} <i class="fa fa-circle" style="color: blue;"></i> {% endif %}<br>
{% endfor %}
</h5>
{% endif %}