diff --git a/bookwyrm/activitypub/base_activity.py b/bookwyrm/activitypub/base_activity.py index 05e7d8a05..aa4b5b687 100644 --- a/bookwyrm/activitypub/base_activity.py +++ b/bookwyrm/activitypub/base_activity.py @@ -396,7 +396,7 @@ def resolve_remote_id( def get_representative(): """Get or create an actor representing the instance - to sign requests to 'secure mastodon' servers""" + to sign outgoing HTTP GET requests""" username = f"{INSTANCE_ACTOR_USERNAME}@{DOMAIN}" email = "bookwyrm@localhost" try: diff --git a/bookwyrm/suggested_users.py b/bookwyrm/suggested_users.py index 3e9bef9c4..a13ee97fd 100644 --- a/bookwyrm/suggested_users.py +++ b/bookwyrm/suggested_users.py @@ -8,6 +8,7 @@ from opentelemetry import trace from bookwyrm import models from bookwyrm.redis_store import RedisStore, r +from bookwyrm.settings import INSTANCE_ACTOR_USERNAME from bookwyrm.tasks import app, SUGGESTED_USERS from bookwyrm.telemetry import open_telemetry @@ -98,9 +99,15 @@ class SuggestedUsers(RedisStore): for (pk, score) in values ] # annotate users with mutuals and shared book counts - users = models.User.objects.filter( - is_active=True, bookwyrm_user=True, id__in=[pk for (pk, _) in values] - ).annotate(mutuals=Case(*annotations, output_field=IntegerField(), default=0)) + users = ( + models.User.objects.filter( + is_active=True, bookwyrm_user=True, id__in=[pk for (pk, _) in values] + ) + .annotate( + mutuals=Case(*annotations, output_field=IntegerField(), default=0) + ) + .exclude(localname=INSTANCE_ACTOR_USERNAME) + ) if local: users = users.filter(local=True) return users.order_by("-mutuals")[:5] diff --git a/bookwyrm/templates/settings/users/user_info.html b/bookwyrm/templates/settings/users/user_info.html index f35c60db9..e07a7e439 100644 --- a/bookwyrm/templates/settings/users/user_info.html +++ b/bookwyrm/templates/settings/users/user_info.html @@ -1,6 +1,7 @@ {% load i18n %} {% load markdown %} {% load humanize %} +{% load utilities %}
{% trans "View user profile" %}
+ {% endif %} + + {% url 'settings-user' user.id as url %} {% if not request.path == url %}{% trans "Go to user admin" %}
diff --git a/bookwyrm/templates/settings/users/user_moderation_actions.html b/bookwyrm/templates/settings/users/user_moderation_actions.html index 4a624a5e4..fd3e66aa8 100644 --- a/bookwyrm/templates/settings/users/user_moderation_actions.html +++ b/bookwyrm/templates/settings/users/user_moderation_actions.html @@ -1,4 +1,5 @@ {% load i18n %} +{% load utilities %}- {% trans "Send direct message" %} -
- {% endif %} + {% if user.localname|is_instance_admin %} ++ {% trans "Send direct message" %} +
+ {% endif %} - {% if not user.is_active and user.deactivation_reason == "pending" %} - - {% endif %} - {% if user.is_active or user.deactivation_reason == "pending" %} - - {% else %} - + {% if not user.is_active and user.deactivation_reason == "pending" %} + + {% endif %} + {% if user.is_active or user.deactivation_reason == "pending" %} + + {% else %} + + {% endif %} + + {% if user.local %} +