Load missing thumbnails after enabling the feature (#725)

This commit is contained in:
Sascha Ißbrücker
2024-05-10 09:50:19 +02:00
committed by GitHub
parent b4376a9ff1
commit 0f9ba57fef
5 changed files with 59 additions and 1 deletions

View File

@@ -70,11 +70,16 @@ def update_profile(request):
user = request.user
profile = user.profile
favicons_were_enabled = profile.enable_favicons
previews_were_enabled = profile.enable_preview_images
form = UserProfileForm(request.POST, instance=profile)
if form.is_valid():
form.save()
# Load missing favicons if the feature was just enabled
if profile.enable_favicons and not favicons_were_enabled:
tasks.schedule_bookmarks_without_favicons(request.user)
# Load missing preview images if the feature was just enabled
if profile.enable_preview_images and not previews_were_enabled:
tasks.schedule_bookmarks_without_previews(request.user)
return form