Fix Celery startup and ImageService temp handling

This commit is contained in:
2025-12-12 20:23:00 +03:00
parent f320eafc55
commit 6023496a7d
3 changed files with 9 additions and 6 deletions

View File

@@ -1,8 +1,6 @@
"""
=8F80;870F8O Celery 4;O 02B><0B8G5A:>9 703@C7:8 ?@8 AB0@B5 Django.
-B> 30@0=B8@C5B GB> Celery app 1C45B 8=8F80;878@>20= 2 <><5=B 70?CA:0 Django,
GB> ?>72>;O5B @shared_task 45:>@0B>@C @01>B0BL ?@028;L=>.
Celery configuration.
This ensures the Celery app is loaded when Django starts.
"""
from .celery import app as celery_app

View File

@@ -73,7 +73,12 @@ class ImageService:
parts = path_str.split('/')
if len(parts) < 3:
return ''
return default_storage.url(path_str)
# Если изображение во временной папке (еще не обработано)
# Возвращаем оригинал, так как других размеров еще нет
if 'temp' in parts:
return default_storage.url(path_str)
# Извлекаем base_path, entity_id, photo_id из пути
base_path = parts[0] # products, kits, categories