chore(api): Remove pre-meta history code from common serializer

ref: #788 #759
This commit is contained in:
2025-06-05 15:41:13 +09:30
parent bf39631db8
commit f79a9d628b
2 changed files with 14 additions and 23 deletions

View File

@ -103,21 +103,21 @@ class CommonModelSerializer(CommonBaseSerializer):
}
)
elif(
history_app_label is not None
and history_model_name is not None
and not hasattr(self.Meta.model, '_audit_enabled')
):
# elif(
# history_app_label is not None
# and history_model_name is not None
# and not hasattr(self.Meta.model, '_audit_enabled')
# ):
get_url['history'] = reverse(
"v2:_api_v2_model_history-list",
request = self._context['view'].request,
kwargs = {
'app_label': history_app_label,
'model_name': history_model_name,
'model_id': item.pk
}
)
# get_url['history'] = reverse(
# "v2:_api_v2_model_history-list",
# request = self._context['view'].request,
# kwargs = {
# 'app_label': history_app_label,
# 'model_name': history_model_name,
# 'model_id': item.pk
# }
# )
obj = getattr(item, 'get_url_kwargs_notes', None)

View File

@ -19,7 +19,6 @@ from centurion.viewsets.base import (
from core.viewsets import (
audit_history,
centurion_model_notes,
history as history_v2,
)
app_name = "API"
@ -84,14 +83,6 @@ router.register(
)
router.register(
prefix = '(?P<app_label>[a-z_]+)/(?P<model_name>.+)/(?P<model_id>[0-9]+)/history',
viewset = history_v2.ViewSet,
basename = '_api_v2_model_history'
)
urlpatterns = [
path('schema', SpectacularAPIView.as_view(api_version='v2'), name='schema-v2',),