From 6fb7a085f6235cadb40dd8580d0e95acc8e707ec Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Wed, 23 Oct 2024 13:41:47 +0300 Subject: [PATCH] Remove avatar field from profile --- .../migrations/0029_remove_profile_avatar.py | 17 +++++++++++++++++ kitsune/users/models.py | 8 -------- kitsune/users/tests/test_auth.py | 5 +---- 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 kitsune/users/migrations/0029_remove_profile_avatar.py diff --git a/kitsune/users/migrations/0029_remove_profile_avatar.py b/kitsune/users/migrations/0029_remove_profile_avatar.py new file mode 100644 index 00000000000..995a6428b48 --- /dev/null +++ b/kitsune/users/migrations/0029_remove_profile_avatar.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.16 on 2024-10-23 03:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0028_alter_profile_bio_and_upper_name_idx"), + ] + + operations = [ + migrations.RemoveField( + model_name="profile", + name="avatar", + ), + ] diff --git a/kitsune/users/models.py b/kitsune/users/models.py index b48e4e424d3..2b255225bf6 100644 --- a/kitsune/users/models.py +++ b/kitsune/users/models.py @@ -62,13 +62,6 @@ class Profile(ModelBase): public_email = models.BooleanField( # show/hide email default=False, verbose_name=_lazy("Make my email address visible to signed in users") ) - avatar = models.ImageField( - upload_to=settings.USER_AVATAR_PATH, - null=True, - blank=True, - verbose_name=_lazy("Avatar"), - max_length=settings.MAX_FILEPATH_LENGTH, - ) bio = models.TextField( null=True, blank=True, @@ -151,7 +144,6 @@ def clear(self): """Clears out the users profile""" self.name = "" self.public_email = False - self.avatar = None self.bio = "" self.website = "" self.twitter = "" diff --git a/kitsune/users/tests/test_auth.py b/kitsune/users/tests/test_auth.py index 9cf1e49ce69..d8db542611c 100644 --- a/kitsune/users/tests/test_auth.py +++ b/kitsune/users/tests/test_auth.py @@ -186,9 +186,7 @@ def test_link_sumo_account_fxa(self, verify_token_mock, requests_mock, message_m verify_token_mock.return_value = True - user = UserFactory.create( - email="sumo@example.com", profile__avatar="sumo_avatar", profile__name="Kenny Bania" - ) + user = UserFactory.create(email="sumo@example.com", profile__name="Kenny Bania") user.profile.is_fxa_migrated = False user.profile.save() auth_request = RequestFactory().get("/foo", {"code": "foo", "state": "bar"}) @@ -218,7 +216,6 @@ def test_link_sumo_account_fxa(self, verify_token_mock, requests_mock, message_m assert user.profile.is_fxa_migrated self.assertEqual(user.profile.fxa_uid, "my_unique_fxa_id") self.assertEqual(user.email, "fxa@example.com") - self.assertEqual(user.profile.avatar, "sumo_avatar") self.assertEqual(user.profile.name, "Kenny Bania") message_mock.info.assert_called_with(auth_request, "fxa_notification_updated")