diff --git a/bookwyrm/templates/feed/feed.html b/bookwyrm/templates/feed/feed.html
index 5c4e14e60..b8e351c9f 100644
--- a/bookwyrm/templates/feed/feed.html
+++ b/bookwyrm/templates/feed/feed.html
@@ -37,7 +37,7 @@
{% trans "There aren't any activities right now! Try following a user to get started" %}
- {% if suggested_users %}
+ {% if request.user.show_suggested_users and suggested_users %}
{# suggested users for when things are very lonely #}
{% include 'feed/suggested_users.html' with suggested_users=suggested_users %}
{% endif %}
@@ -46,7 +46,7 @@
{% for activity in activities %}
-{% if not activities.number > 1 and forloop.counter0 == 2 and suggested_users %}
+{% if request.user.show_suggested_users and not activities.number > 1 and forloop.counter0 == 2 and suggested_users %}
{# suggested users on the first page, two statuses down #}
{% include 'feed/suggested_users.html' with suggested_users=suggested_users %}
{% endif %}
diff --git a/bookwyrm/templates/feed/suggested_users.html b/bookwyrm/templates/feed/suggested_users.html
index 1de1ae139..4e9f822b5 100644
--- a/bookwyrm/templates/feed/suggested_users.html
+++ b/bookwyrm/templates/feed/suggested_users.html
@@ -1,6 +1,15 @@
{% load i18n %}
- {% trans "Who to follow" %}
+
{% include 'snippets/suggested_users.html' with suggested_users=suggested_users %}
{% trans "View directory" %}
diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py
index 991114fad..9ae1b8228 100644
--- a/bookwyrm/urls.py
+++ b/bookwyrm/urls.py
@@ -215,6 +215,7 @@ urlpatterns = [
views.Following.as_view(),
name="user-following",
),
+ re_path(r"^hide-suggestions/?$", views.hide_suggestions, name="hide-suggestions"),
# lists
re_path(r"%s/lists/?$" % USER_PATH, views.UserLists.as_view(), name="user-lists"),
re_path(r"^list/?$", views.Lists.as_view(), name="lists"),
diff --git a/bookwyrm/views/__init__.py b/bookwyrm/views/__init__.py
index 841026a54..5142d532d 100644
--- a/bookwyrm/views/__init__.py
+++ b/bookwyrm/views/__init__.py
@@ -43,6 +43,6 @@ from .shelf import shelve, unshelve
from .site import Site
from .status import CreateStatus, DeleteStatus, DeleteAndRedraft
from .updates import get_notification_count, get_unread_status_count
-from .user import User, Followers, Following
+from .user import User, Followers, Following, hide_suggestions
from .user_admin import UserAdmin, UserAdminList
from .wellknown import *
diff --git a/bookwyrm/views/user.py b/bookwyrm/views/user.py
index 87e42b4e9..e335b02cb 100644
--- a/bookwyrm/views/user.py
+++ b/bookwyrm/views/user.py
@@ -1,8 +1,11 @@
""" non-interactive pages """
+from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
+from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils import timezone
from django.views import View
+from django.views.decorators.http import require_POST
from bookwyrm import models
from bookwyrm.activitypub import ActivitypubResponse
@@ -118,3 +121,12 @@ class Following(View):
"follow_list": paginated.get_page(request.GET.get("page")),
}
return TemplateResponse(request, "user/relationships/following.html", data)
+
+
+@require_POST
+@login_required
+def hide_suggestions(request):
+ """not everyone wants user suggestions"""
+ request.user.show_suggested_users = False
+ request.user.save(broadcast=False, update_fields=["show_suggested_users"])
+ return redirect(request.headers.get("Referer", "/"))