projects: модуль проектов с шагами по отделам и Task.

Шаблоны/ручное создание, access_projects, сид «Открытие аптеки». Плюс SILO/S3 для Django media.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-23 16:26:45 +03:00
parent 69ae14f65e
commit 030bbc98fd
28 changed files with 2129 additions and 3 deletions
+21
View File
@@ -0,0 +1,21 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
from apps.tasks.models import Task
@receiver(post_save, sender=Task)
def recalculate_project_on_task_change(sender, instance: Task, **kwargs):
from apps.projects.models import ProjectStepItem
from apps.projects.services import refresh_project_status
item = (
ProjectStepItem.objects
.filter(task_id=instance.pk)
.select_related('step__project')
.first()
)
if item is None:
return
item.step.refresh_status(save=True)
refresh_project_status(item.step.project)