feat: complete multimodal ticket intake
This commit is contained in:
@@ -18,13 +18,13 @@ def execute_ticket_draft_analysis(draft_id: int, run_id: int) -> None:
|
||||
def cleanup_expired_ticket_drafts() -> int:
|
||||
queryset = TicketDraft.objects.filter(
|
||||
expires_at__lt=timezone.now(), confirmed_ticket__isnull=True
|
||||
).prefetch_related("images")
|
||||
).prefetch_related("materials")
|
||||
count = queryset.count()
|
||||
for draft in queryset:
|
||||
public_id = str(draft.public_id)
|
||||
for image in draft.images.all():
|
||||
for material in draft.materials.all():
|
||||
try:
|
||||
delete_object(image.storage_path)
|
||||
delete_object(material.storage_path)
|
||||
except Exception:
|
||||
pass
|
||||
OperationAuditLog.objects.create(
|
||||
@@ -36,7 +36,7 @@ def cleanup_expired_ticket_drafts() -> int:
|
||||
request_snapshot={
|
||||
"status": draft.status,
|
||||
"guided_rounds": draft.guided_rounds,
|
||||
"image_count": draft.images.count(),
|
||||
"material_count": draft.materials.count(),
|
||||
},
|
||||
result="success",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user