Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove avatar field from profile #6308

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.bio = ""
self.website = ""
self.twitter = ""
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="[email protected]", profile__avatar="sumo_avatar", profile__name="Kenny Bania"
)
user = UserFactory.create(email="[email protected]", 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, "[email protected]")
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