@ -17,7 +17,7 @@ from config_management.models.config_groups_hosts_history import ConfigGroupHost
|
||||
from config_management.models.config_groups_software_history import ConfigGroupSoftware, ConfigGroupSoftwareHistory
|
||||
|
||||
from core.models.history import History
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerHistory
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerAuditHistory
|
||||
|
||||
from itam.models.device_history import Device, DeviceHistory
|
||||
from itam.models.device_model_history import DeviceModel, DeviceModelHistory
|
||||
@ -318,7 +318,7 @@ def model_details(item_pk, item_class) -> dict:
|
||||
|
||||
model_class = Manufacturer
|
||||
|
||||
history_class = ManufacturerHistory
|
||||
history_class = ManufacturerAuditHistory
|
||||
|
||||
case 'operatingsystem':
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.1.9 on 2025-05-17 16:55
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0025_alter_modelhistory_action_alter_modelhistory_after_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='ManufacturerHistory',
|
||||
new_name='ManufacturerAuditHistory',
|
||||
),
|
||||
]
|
@ -120,12 +120,12 @@ class Manufacturer(TenancyObject, ManufacturerCommonFields, SaveHistory):
|
||||
|
||||
def save_history(self, before: dict, after: dict) -> bool:
|
||||
|
||||
from core.models.manufacturer_history import ManufacturerHistory
|
||||
from core.models.manufacturer_history import ManufacturerAuditHistory
|
||||
|
||||
history = super().save_history(
|
||||
before = before,
|
||||
after = after,
|
||||
history_model = ManufacturerHistory
|
||||
history_model = ManufacturerAuditHistory
|
||||
)
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@ from core.models.manufacturer import Manufacturer
|
||||
|
||||
|
||||
|
||||
class ManufacturerHistory(
|
||||
class ManufacturerAuditHistory(
|
||||
ModelHistory
|
||||
):
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerHistory
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerAuditHistory
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ class History(
|
||||
|
||||
model = Manufacturer
|
||||
|
||||
history_model = ManufacturerHistory
|
||||
history_model = ManufacturerAuditHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
|
@ -1,7 +1,7 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerHistory
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerAuditHistory
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ class ModelHistoryAPI(
|
||||
|
||||
audit_model = Manufacturer
|
||||
|
||||
model = ManufacturerHistory
|
||||
model = ManufacturerAuditHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
@ -1,7 +1,7 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerHistory
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerAuditHistory
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import BaseModelHistoryAPI
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ class ModelHistoryAPI(
|
||||
|
||||
audit_model = Manufacturer
|
||||
|
||||
model = ManufacturerHistory
|
||||
model = ManufacturerAuditHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
@ -1,7 +1,7 @@
|
||||
from drf_spectacular.utils import extend_schema, extend_schema_view, OpenApiResponse
|
||||
|
||||
# THis import only exists so that the migrations can be created
|
||||
from core.models.manufacturer_history import ManufacturerHistory # pylint: disable=W0611:unused-import
|
||||
from core.models.manufacturer_history import ManufacturerAuditHistory # pylint: disable=W0611:unused-import
|
||||
from core.serializers.manufacturer import (
|
||||
Manufacturer,
|
||||
ManufacturerModelSerializer,
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from core.models.manufacturer_history import Manufacturer, ManufacturerHistory
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI
|
||||
|
||||
from devops.models.feature_flag_history import FeatureFlag, FeatureFlagHistory
|
||||
|
Reference in New Issue
Block a user