diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 57a94e3c..c9e795c3 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 00000000..f1c8e7c3 --- /dev/null +++ b/bookwyrm/migrations/0046_user_default_post_privacy.py @@ -0,0 +1,27 @@ +# 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/migrations/0079_merge_20210804_1746.py b/bookwyrm/migrations/0079_merge_20210804_1746.py new file mode 100644 index 00000000..ed5d50d0 --- /dev/null +++ b/bookwyrm/migrations/0079_merge_20210804_1746.py @@ -0,0 +1,13 @@ +# Generated by Django 3.2.4 on 2021-08-04 17:46 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0046_user_default_post_privacy"), + ("bookwyrm", "0078_add_shelved_date"), + ] + + operations = [] diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 3eb72cb6..21b6bbaa 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -105,6 +105,9 @@ 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 9e2af7be..6732b8ef 100644 --- a/bookwyrm/templates/preferences/edit_user.html +++ b/bookwyrm/templates/preferences/edit_user.html @@ -53,6 +53,14 @@ {{ form.manually_approves_followers }} +
+ +
+ {{ form.default_post_privacy }} +
+