diff --git a/app/logger/tests/test_user_profile.py b/app/logger/tests/test_user_profile.py index ad32124a..9cb5363a 100644 --- a/app/logger/tests/test_user_profile.py +++ b/app/logger/tests/test_user_profile.py @@ -156,25 +156,6 @@ def test_user_profile_page_with_various_privacy_settings(self): self.assertEqual(response.status_code, 200) self.assertContains(response, self.user.name) - @tag("privacy") - def test_public_statistics_privacy_setting(self): - """Test that the public statistics privacy setting works""" - for i in range(0, 50): - TripFactory(user=self.user) - self.user.public_statistics = False - self.user.save() - - response = self.client.get(self.user.get_absolute_url()) - self.assertEqual(response.status_code, 200) - self.assertNotContains(response, '
Profile settings
-
-
- Statistics -
- -
- {% if user.privacy == user.PRIVATE %} - Public statistics are disabled as your profile is private. - {% else %} - Statistics are {% if not user.public_statistics %}not {% endif %}shown on your profile page. - {% endif %} -
-
-
Biography diff --git a/app/users/admin.py b/app/users/admin.py index e81cfbe3..0830f06d 100644 --- a/app/users/admin.py +++ b/app/users/admin.py @@ -114,7 +114,6 @@ class CavingUserAdmin(BaseUserAdmin, ModelAdmin): "allow_friend_email", "allow_friend_username", "allow_comments", - "public_statistics", "email_friend_requests", ), }, diff --git a/app/users/factories.py b/app/users/factories.py index 24cefc10..89d3ac66 100644 --- a/app/users/factories.py +++ b/app/users/factories.py @@ -20,7 +20,6 @@ class Meta: location = factory.Faker("city") clubs = factory.LazyFunction(generate_club) timezone = factory.Faker("timezone") - public_statistics = factory.Faker("pybool") allow_friend_email = factory.Faker("pybool") allow_friend_username = factory.Faker("pybool") allow_comments = factory.Faker("pybool") diff --git a/app/users/forms.py b/app/users/forms.py index a3630fa9..8b53afca 100644 --- a/app/users/forms.py +++ b/app/users/forms.py @@ -289,7 +289,6 @@ class Meta: "allow_friend_email", "allow_comments", "show_cavers_on_trip_list", - "public_statistics", "disable_distance_statistics", "disable_survey_statistics", "disable_stats_over_time", @@ -318,7 +317,6 @@ def __init__(self, *args, **kwargs): ), HTML('
Statistics
'), Div( - Div("public_statistics", css_class="col"), Div("disable_distance_statistics", css_class="col"), Div("disable_survey_statistics", css_class="col"), Div("disable_stats_over_time", css_class="col"), diff --git a/app/users/migrations/0044_remove_cavinguser_public_statistics.py b/app/users/migrations/0044_remove_cavinguser_public_statistics.py new file mode 100644 index 00000000..34f7f08f --- /dev/null +++ b/app/users/migrations/0044_remove_cavinguser_public_statistics.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2 on 2023-12-19 10:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("users", "0043_cavinguser_profile_view_count"), + ] + + operations = [ + migrations.RemoveField( + model_name="cavinguser", + name="public_statistics", + ), + ] diff --git a/app/users/models.py b/app/users/models.py index 1043f1aa..6e6d00b2 100644 --- a/app/users/models.py +++ b/app/users/models.py @@ -259,14 +259,6 @@ class CavingUser(AbstractBaseUser, PermissionsMixin): "comments, but will hide them until it is re-enabled." ), ) - public_statistics = models.BooleanField( - "Show statistics on profile", - default=True, - help_text=( - "Enabling this option will show an annual statistics table on your " - "profile page which will be visible to anyone who can view your profile." - ), - ) disable_distance_statistics = models.BooleanField( "Disable distance statistics", default=False, diff --git a/app/users/tests/test_custom_user_model.py b/app/users/tests/test_custom_user_model.py index ba945c3d..788bfe35 100644 --- a/app/users/tests/test_custom_user_model.py +++ b/app/users/tests/test_custom_user_model.py @@ -464,7 +464,6 @@ def test_submit_updates_to_settings(self): "privacy": "Friends", "timezone": "US/Central", "units": "Imperial", - "public_statistics": True, "settings_submit": "Save", }, follow=True, @@ -480,7 +479,6 @@ def test_submit_updates_to_settings(self): self.assertEqual(self.user.privacy, self.user.FRIENDS) self.assertEqual(self.user.timezone, ZoneInfo("US/Central")) self.assertEqual(self.user.units, self.user.IMPERIAL) - self.assertTrue(self.user.public_statistics) def test_submit_invalid_updates_to_profile(self): """Test submitting invalid updates to a user's profile"""