From 6ce05296b01b1bd177e93b5ea3745fba5a5ff8f2 Mon Sep 17 00:00:00 2001 From: Tyler Kennedy Date: Sun, 4 Dec 2022 11:41:41 -0500 Subject: Make follows a top-level activity. (#94) --- users/views/follows.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 users/views/follows.py (limited to 'users/views') diff --git a/users/views/follows.py b/users/views/follows.py deleted file mode 100644 index 9030efe..0000000 --- a/users/views/follows.py +++ /dev/null @@ -1,33 +0,0 @@ -from django.utils.decorators import method_decorator -from django.views.generic import TemplateView - -from users.decorators import identity_required -from users.models import FollowStates - - -@method_decorator(identity_required, name="dispatch") -class FollowsPage(TemplateView): - """ - Shows followers/follows. - """ - - template_name = "settings/follows.html" - - def get_context_data(self): - # Gather all identities with a following relationship with us - identities = {} - for outbound_follow in self.request.identity.outbound_follows.filter( - state__in=FollowStates.group_active() - ): - identities.setdefault(outbound_follow.target, {})[ - "outbound" - ] = outbound_follow - for inbound_follow in self.request.identity.inbound_follows.filter( - state__in=FollowStates.group_active() - ): - identities.setdefault(inbound_follow.source, {})["inbound"] = inbound_follow - - return { - "section": "follows", - "identities": sorted(identities.items(), key=lambda i: i[0].username), - } -- cgit v1.2.3