Skip to content
Snippets Groups Projects
Verified Commit d5bcc1df authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Move favicon files to the public directory to make them accessible without a titofisto token

parent 49e9ddbf
No related branches found
No related tags found
1 merge request!747Resolve "Caching issues"
Pipeline #38094 canceled
# Generated by Django 3.2.4 on 2021-07-24 13:14
import os
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0020_pdf_file_person_optional'),
]
def _migrate_favicons(apps, schema_editor):
FaviconImg = apps.get_model('favicon', "FaviconImg")
for favicon_img in FaviconImg.objects.all():
old_name = favicon_img.faviconImage.name
new_name = os.path.join("public", old_name)
storage = favicon_img.faviconImage.storage
if storage.exists(old_name):
storage.save(new_name, favicon_img.faviconImage.file)
favicon_img.faviconImage.name = new_name
favicon_img.save()
operations = [
migrations.RunPython(_migrate_favicons)
]
......@@ -635,6 +635,7 @@ PWA_ICONS_CONFIG = {
"apple_splash": [192],
"microsoft": [144],
}
FAVICON_PATH = os.path.join("public", "favicon")
SERVICE_WORKER_PATH = os.path.join(STATIC_ROOT, "js", "serviceworker.js")
......
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