From f588dc6cff38a27119f5b2e9d3eb3eb34a580896 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 5 Jul 2024 01:37:19 +0100 Subject: [PATCH] Add audit log entry for CDB changing package state --- app/tasks/pkgtasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/tasks/pkgtasks.py b/app/tasks/pkgtasks.py index c76fbe26..2cbc4da8 100644 --- a/app/tasks/pkgtasks.py +++ b/app/tasks/pkgtasks.py @@ -27,9 +27,9 @@ import urllib3 from sqlalchemy import or_, and_ from app.markdown import get_links, render_markdown -from app.models import Package, db, PackageState, AuditLogEntry +from app.models import Package, db, PackageState, AuditLogEntry, AuditSeverity from app.tasks import celery, TaskError -from app.utils import post_bot_message, post_to_approval_thread, get_system_user +from app.utils import post_bot_message, post_to_approval_thread, get_system_user, add_audit_log @celery.task() @@ -186,6 +186,7 @@ def check_package_on_submit(package_id: int): post_to_approval_thread(package, system_user, marked, is_status_update=True, create_thread=True) post_to_approval_thread(package, system_user, msg, is_status_update=False, create_thread=True) package.state = PackageState.CHANGES_NEEDED + add_audit_log(AuditSeverity.EDITOR, system_user, marked, package.get_url("packages.view"), package) db.session.commit()