key findings
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from celery import shared_task
|
||||
from backend.core.models import Organization, Document, Risk, Control, DocumentRiskControl
|
||||
from backend.core.utils import get_top_risk, get_controls_for_risk
|
||||
from backend.core.utils import get_top_risk, get_controls_for_risk, generate_key_findings
|
||||
from django.shortcuts import get_object_or_404, render
|
||||
from .utils import send_payment_email
|
||||
|
||||
from backend.core.tables import get_risk_table
|
||||
|
||||
@shared_task
|
||||
def create_document_for_organization(confirmation_email):
|
||||
@@ -53,5 +53,10 @@ def create_document_for_organization(confirmation_email):
|
||||
|
||||
document.add_segment('body', controls_content)
|
||||
|
||||
|
||||
risks_by_weight = get_risk_table(document)[:3]
|
||||
key_findings = generate_key_findings(document, risks_by_weight)
|
||||
if key_findings:
|
||||
document.key_findings = key_findings
|
||||
document.save()
|
||||
|
||||
send_payment_email(confirmation_email)
|
||||
Reference in New Issue
Block a user