Skip to content
Snippets Groups Projects
Commit 008ddc1e authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Delete FaviconImg objects of Favicon object when it is updated

parent 0b33fe6f
No related branches found
No related tags found
1 merge request!831Resolve "Firefox app icon not updated"
Pipeline #49369 canceled
......@@ -23,6 +23,7 @@ Added
Fixed
~~~~~
* Existing FaviconImg objects were not updated when a new Favicon image is uploaded via preferences
* GroupManager.get_queryset() returned an incomplete QuerySet
* OAuth was broken by a non-semver-adhering django-oauth-toolkit update
* Too long texts in chips didn't result in a larger chip.
......
......@@ -97,15 +97,16 @@ class CoreConfig(AppConfig):
if name in ("primary", "secondary"):
clean_scss()
elif name in ("favicon", "pwa_icon"):
from favicon.models import Favicon # noqa
from favicon.models import Favicon, FaviconImg # noqa
is_favicon = name == "favicon"
if new_value:
Favicon.on_site.update_or_create(
favicon_id = Favicon.on_site.update_or_create(
title=name,
defaults={"isFavicon": is_favicon, "faviconImage": new_value},
)
)[0]
FaviconImg.objects.filter(faviconFK=favicon_id).delete()
else:
Favicon.on_site.filter(title=name, isFavicon=is_favicon).delete()
if name in settings.DEFAULT_FAVICON_PATHS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment