Use auditlog for ServiceInstance objects
All checks were successful
Tests / test (push) Successful in 25s

This commit is contained in:
Tobias Kunze 2025-09-05 15:10:47 +02:00
parent 7cc0e76895
commit 6545f32e39
2 changed files with 6 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import re
import kubernetes import kubernetes
import rules import rules
import urlman import urlman
from auditlog.registry import auditlog
from django.conf import settings from django.conf import settings
from django.core.cache import cache from django.core.cache import cache
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
@ -921,3 +922,6 @@ class ServiceInstance(ServalaModelMixin, models.Model):
return {"error": str(e)} return {"error": str(e)}
except Exception as e: except Exception as e:
return {"error": str(e)} return {"error": str(e)}
auditlog.register(ServiceInstance, exclude_fields=["updated_at"], serialize_data=True)

View file

@ -157,6 +157,7 @@ INSTALLED_APPS = [
"allauth.account", "allauth.account",
"allauth.socialaccount", "allauth.socialaccount",
"allauth.socialaccount.providers.openid_connect", "allauth.socialaccount.providers.openid_connect",
"auditlog",
"servala.core", "servala.core",
] ]
@ -170,6 +171,7 @@ MIDDLEWARE = [
"django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware",
"allauth.account.middleware.AccountMiddleware", "allauth.account.middleware.AccountMiddleware",
"django.contrib.auth.middleware.LoginRequiredMiddleware", "django.contrib.auth.middleware.LoginRequiredMiddleware",
"auditlog.middleware.AuditlogMiddleware",
"servala.core.middleware.OrganizationMiddleware", "servala.core.middleware.OrganizationMiddleware",
] ]
LOGIN_URL = "account_login" LOGIN_URL = "account_login"