Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(manager): invalidate cache on system opt-out #1729

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions manager/system_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""
Module for /systems API endpoint
"""
from datetime import datetime
from datetime import timezone

import dateutil.parser
from connexion import context
from peewee import JOIN
Expand All @@ -23,6 +26,7 @@
from common.peewee_model import CveMetadata
from common.peewee_model import InsightsRule
from common.peewee_model import InventoryHosts
from common.peewee_model import RHAccount
from common.peewee_model import SystemCveData
from common.peewee_model import SystemPlatform
from common.peewee_model import SystemVulnerabilities
Expand Down Expand Up @@ -762,4 +766,5 @@ def handle_patch(cls, **kwargs):
updated.append(system.inventory_id)
if not updated:
raise ApplicationException("inventory_id must exist and inventory_id must be visible to user", 404)
RHAccount.update(last_status_change=datetime.now(timezone.utc)).where(RHAccount.id == rh_account_id).execute()
return {"updated": updated}
Loading