0001-pwa-use-icon-file-basename-during-import-49149.patch
combo/apps/pwa/models.py | ||
---|---|---|
18 | 18 | |
19 | 19 |
import base64 |
20 | 20 |
import json |
21 |
import os |
|
21 | 22 | |
22 | 23 |
from django.conf import settings |
23 | 24 |
from django.core import serializers |
... | ... | |
188 | 189 |
decoded_icon = base64.decodebytes(force_bytes(json_entry['icon:base64'])) |
189 | 190 |
if not default_storage.exists(entry.object.icon.name) or entry.object.icon.read() != decoded_icon: |
190 | 191 |
# save new file |
191 |
entry.object.icon.save(entry.object.icon.name, ContentFile(decoded_icon))
|
|
192 |
entry.object.icon.save(os.path.basename(entry.object.icon.name), ContentFile(decoded_icon))
|
|
192 | 193 | |
193 | 194 | |
194 | 195 |
class PushSubscription(models.Model): |
195 |
- |