Skip to content

Commit

Permalink
Merge pull request #6308 from akatsoulas/remove-profile-avatar
Browse files Browse the repository at this point in the history
Remove avatar field from profile
  • Loading branch information
akatsoulas authored Oct 24, 2024
2 parents fcb53a1 + 384a4b1 commit 25510d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
17 changes: 17 additions & 0 deletions kitsune/users/migrations/0029_remove_profile_avatar.py
Original file line number Diff line number Diff line change
@@ -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",
),
]
8 changes: 0 additions & 8 deletions kitsune/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -151,7 +144,6 @@ def clear(self):
"""Clears out the users profile"""
self.name = ""
self.public_email = False
self.avatar = None
self.fxa_avatar = ""
self.bio = ""
self.website = ""
Expand Down
5 changes: 1 addition & 4 deletions kitsune/users/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 25510d0

Please sign in to comment.