From 547e4d3731a6492eb4b9d088ee268720224713d1 Mon Sep 17 00:00:00 2001 From: hsd2514 <150319109+hsd2514@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:39:27 +0000 Subject: [PATCH] Changing default value for Gravatar URL from ( mm -> mp ) - See https://docs.gravatar.com/api/avatars/images/#default-image - Fixes #12658 --- CHANGELOG.txt | 1 + CONTRIBUTORS.md | 1 + docs/releases/6.4.md | 1 + wagtail/admin/tests/ui/test_sidebar.py | 2 +- wagtail/users/utils.py | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0eef17a620..9875787847 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -87,6 +87,7 @@ Changelog * Maintenance: Use the Stimulus `ZoneController` (`w-zone`) to remove ad-hoc jQuery for the privacy switch when toggling visibility of private/public elements (Ayaan Qadri) * Maintenance: Remove unused `is_active` & `active_menu_items` from `wagtail.admin.menu.MenuItem` (Srishti Jaiswal) * Maintenance: Only call `openpyxl` at runtime to improve performance for projects that do not use `ReportView`, `SpreadsheetExportMixin` and `wagtail.contrib.redirects` (Sébastien Corbin) + * Maintenance: Adopt the update value `mp` instead of `mm` for 'mystery person' as the default Gravatar if no avatar found (Harsh Dange) 6.3.2 (xx.xx.xxxx) - IN DEVELOPMENT diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1fbd97cac3..3a93220731 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -858,6 +858,7 @@ * Noah van der Meer * Strapchay * Alex Fulcher +* Harsh Dange ## Translators diff --git a/docs/releases/6.4.md b/docs/releases/6.4.md index c6aa5b5c00..b043aab52d 100644 --- a/docs/releases/6.4.md +++ b/docs/releases/6.4.md @@ -105,6 +105,7 @@ depth: 1 * Use the Stimulus `ZoneController` (`w-zone`) to remove ad-hoc jQuery for the privacy switch when toggling visibility of private/public elements (Ayaan Qadri) * Remove unused `is_active` & `active_menu_items` from `wagtail.admin.menu.MenuItem` (Srishti Jaiswal) * Only call `openpyxl` at runtime to improve performance for projects that do not use `ReportView`, `SpreadsheetExportMixin` and `wagtail.contrib.redirects` (Sébastien Corbin) + * Adopt the update value `mp` instead of `mm` for 'mystery person' as the default Gravatar if no avatar found (Harsh Dange) ## Upgrade considerations - changes affecting all projects diff --git a/wagtail/admin/tests/ui/test_sidebar.py b/wagtail/admin/tests/ui/test_sidebar.py index e5c21bc7f0..f2e1601446 100644 --- a/wagtail/admin/tests/ui/test_sidebar.py +++ b/wagtail/admin/tests/ui/test_sidebar.py @@ -283,7 +283,7 @@ class TestAdaptMainMenuModule(WagtailTestUtils, DjangoTestCase): ], { "name": user.first_name or user.get_username(), - "avatarUrl": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=100&d=mm", + "avatarUrl": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=100&d=mp", }, ], }, diff --git a/wagtail/users/utils.py b/wagtail/users/utils.py index ef3f0e6bb9..b3eee7970d 100644 --- a/wagtail/users/utils.py +++ b/wagtail/users/utils.py @@ -26,7 +26,7 @@ def user_can_delete_user(current_user, user_to_delete): def get_gravatar_url(email, size=50): - default = "mm" + default = "mp" size = ( int(size) * 2 ) # requested at retina size by default and scaled down at point of use with css