Only show pending follow requests from active users

This commit is contained in:
Mouse Reeve 2022-07-24 12:26:58 -07:00
parent 056f9c45a4
commit f3bc7d759f
2 changed files with 6 additions and 1 deletions

View file

@ -174,6 +174,11 @@ class User(OrderedCollectionPageMixin, AbstractUser):
property_fields = [("following_link", "following")]
field_tracker = FieldTracker(fields=["name", "avatar"])
@property
def active_follower_requests(self):
"""Follow requests from active users"""
return self.follower_requests.filter(is_active=True)
@property
def confirmation_link(self):
"""helper for generating confirmation links"""

View file

@ -43,7 +43,7 @@
{% include 'ostatus/remote_follow_button.html' with user=user %}
{% endif %}
{% if is_self and user.follower_requests.all %}
{% if is_self and user.active_follower_requests.all %}
<div class="follow-requests">
<h2>{% trans "Follow Requests" %}</h2>
{% for requester in user.follower_requests.all %}