diff --git a/README.md b/README.md index 161f91b94..bd7344df9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Social reading and reviewing, decentralized with ActivityPub - [Set up Bookwyrm](#set-up-bookwyrm) ## Joining BookWyrm -BookWyrm is still a young piece of software, and isn't at the level of stability and feature-richness that you'd find in a production-ready application. But it does what it says on the box! If you'd like to join an instance, you can check out the [instances](https://docs.joinbookwyrm.com/instances.html) list. +BookWyrm is still a young piece of software, and isn't at the level of stability and feature-richness that you'd find in a production-ready application. But it does what it says on the box! If you'd like to join an instance, you can check out the [instances](https://joinbookwyrm.com/instances/) list. You can request an invite by entering your email address at https://bookwyrm.social. diff --git a/bookwyrm/activitypub/person.py b/bookwyrm/activitypub/person.py index 576e7f9a6..61c15a579 100644 --- a/bookwyrm/activitypub/person.py +++ b/bookwyrm/activitypub/person.py @@ -39,4 +39,5 @@ class Person(ActivityObject): bookwyrmUser: bool = False manuallyApprovesFollowers: str = False discoverable: str = False + hideFollows: str = False type: str = "Person" diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 7ae4e446f..33d453e60 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -153,6 +153,7 @@ class EditUserForm(CustomForm): "manually_approves_followers", "default_post_privacy", "discoverable", + "hide_follows", "preferred_timezone", "preferred_language", ] diff --git a/bookwyrm/migrations/0142_user_hide_follows.py b/bookwyrm/migrations/0142_user_hide_follows.py new file mode 100644 index 000000000..f052d7ef5 --- /dev/null +++ b/bookwyrm/migrations/0142_user_hide_follows.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.12 on 2022-02-28 19:44 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0141_alter_report_status"), + ] + + operations = [ + migrations.AddField( + model_name="user", + name="hide_follows", + field=bookwyrm.models.fields.BooleanField(default=False), + ), + ] diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 29b3ba9cc..17fcd4587 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -227,7 +227,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): @classmethod def privacy_filter(cls, viewer, privacy_levels=None): queryset = super().privacy_filter(viewer, privacy_levels=privacy_levels) - return queryset.filter(deleted=False) + return queryset.filter(deleted=False, user__is_active=True) @classmethod def direct_filter(cls, queryset, viewer): diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 6367dcaef..666ac612c 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -136,6 +136,7 @@ class User(OrderedCollectionPageMixin, AbstractUser): updated_date = models.DateTimeField(auto_now=True) last_active_date = models.DateTimeField(default=timezone.now) manually_approves_followers = fields.BooleanField(default=False) + hide_follows = fields.BooleanField(default=False) # options to turn features on and off show_goal = models.BooleanField(default=True) @@ -478,10 +479,13 @@ def set_remote_server(user_id): get_remote_reviews.delay(user.outbox) -def get_or_create_remote_server(domain): +def get_or_create_remote_server(domain, refresh=False): """get info on a remote server""" + server = FederatedServer() try: - return FederatedServer.objects.get(server_name=domain) + server = FederatedServer.objects.get(server_name=domain) + if not refresh: + return server except FederatedServer.DoesNotExist: pass @@ -496,13 +500,15 @@ def get_or_create_remote_server(domain): application_type = data.get("software", {}).get("name") application_version = data.get("software", {}).get("version") except ConnectorException: + if server.id: + return server application_type = application_version = None - server = FederatedServer.objects.create( - server_name=domain, - application_type=application_type, - application_version=application_version, - ) + server.server_name = domain + server.application_type = application_type + server.application_version = application_version + + server.save() return server diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 60e3d4fd8..0e2fd5d39 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -352,7 +352,7 @@ {% endfor %} - {% if request.user.list_set.exists %} + {% if list_options.exists %}
{% csrf_token %} @@ -361,7 +361,7 @@
diff --git a/bookwyrm/templates/directory/user_card.html b/bookwyrm/templates/directory/user_card.html index ccae925a1..5a17dbe42 100644 --- a/bookwyrm/templates/directory/user_card.html +++ b/bookwyrm/templates/directory/user_card.html @@ -33,7 +33,7 @@