From 8c5d9620b390d540aefa118bf7dcf55832e26bf0 Mon Sep 17 00:00:00 2001 From: LeandroJatai Date: Sat, 17 Sep 2022 10:55:34 -0300 Subject: [PATCH] altera nome de classmethod --- drfautoapi/drfautoapi.py | 2 +- sapl/api/views_materia.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drfautoapi/drfautoapi.py b/drfautoapi/drfautoapi.py index 03c8059d1..48e0b7770 100644 --- a/drfautoapi/drfautoapi.py +++ b/drfautoapi/drfautoapi.py @@ -147,7 +147,7 @@ class ApiViewSetConstrutor(): filter_backends = (DjangoFilterBackend,) @classmethod - def get_class_for_model(cls, model): + def get_viewset_for_model(cls, model): return cls._built_sets[model._meta.app_config][model] @classmethod diff --git a/sapl/api/views_materia.py b/sapl/api/views_materia.py index 5f54e3b8c..47ef3a3ca 100644 --- a/sapl/api/views_materia.py +++ b/sapl/api/views_materia.py @@ -100,7 +100,7 @@ class _MateriaLegislativaViewSet: ultima_tramitacao = materia.tramitacao_set.order_by( '-data_tramitacao', '-id').first() - serializer_class = MateriaApiViewSetConstrutor.get_class_for_model( + serializer_class = MateriaApiViewSetConstrutor.get_viewset_for_model( Tramitacao).serializer_class(ultima_tramitacao) return Response(serializer_class.data)