diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 57a94e3cd..c9e795c3e 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -132,6 +132,7 @@ class EditUserForm(CustomForm): "summary", "show_goal", "manually_approves_followers", + "default_post_privacy", "discoverable", "preferred_timezone", ] diff --git a/bookwyrm/migrations/0046_user_default_post_privacy.py b/bookwyrm/migrations/0046_user_default_post_privacy.py new file mode 100644 index 000000000..3f2254726 --- /dev/null +++ b/bookwyrm/migrations/0046_user_default_post_privacy.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2021-02-14 00:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0045_auto_20210210_2114'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='default_post_privacy', + field=models.CharField(choices=[('public', 'Public'), ('unlisted', 'Unlisted'), ('followers', 'Followers'), ('direct', 'Direct')], default='public', max_length=255), + ), + ] diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 3eb72cb66..33102f98b 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -26,7 +26,6 @@ from .base_model import BookWyrmModel, DeactivationReason from .federated_server import FederatedServer from . import fields, Review - class User(OrderedCollectionPageMixin, AbstractUser): """a user who wants to read books""" @@ -105,6 +104,11 @@ class User(OrderedCollectionPageMixin, AbstractUser): through_fields=("user", "status"), related_name="favorite_statuses", ) + default_post_privacy = models.CharField( + max_length=255, + default='public', + choices=fields.PrivacyLevels.choices + ) remote_id = fields.RemoteIdField(null=True, unique=True, activitypub_field="id") created_date = models.DateTimeField(auto_now_add=True) updated_date = models.DateTimeField(auto_now=True) diff --git a/bookwyrm/templates/preferences/edit_user.html b/bookwyrm/templates/preferences/edit_user.html index 9e2af7bee..6aed40213 100644 --- a/bookwyrm/templates/preferences/edit_user.html +++ b/bookwyrm/templates/preferences/edit_user.html @@ -53,6 +53,12 @@ {{ form.manually_approves_followers }} +
+ +