Fix: Auto-cleanup temp files after photo processing

- Added temp file deletion in Celery task after successful processing
- Added temp file cleanup in sync fallback method
- Added temp file removal in delete() if processing never completed
- Prevents accumulation of orphaned files in media/<entity>/temp/ folders
This commit is contained in:
2025-11-15 22:28:41 +03:00
parent 53fbb6d3c1
commit 9363527e50
9 changed files with 275 additions and 18 deletions

View File

@@ -193,6 +193,11 @@ class BaseProductEntity(models.Model):
"""Физическое удаление из БД (необратимо! только для старых товаров)"""
super().delete()
@property
def is_active(self):
"""Возвращает True если товар активен"""
return self.status == 'active'
def save(self, *args, **kwargs):
"""
Автогенерация slug из name если не задан.