Skip to content

Commit

Permalink
Add audit log entry for CDB changing package state
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Jul 5, 2024
1 parent 8605ee6 commit f588dc6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/tasks/pkgtasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
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()
Expand Down Expand Up @@ -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()


Expand Down

0 comments on commit f588dc6

Please sign in to comment.