Cecilia

apis

from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets, filters
from rest_framework.permissions import IsAuthenticated
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated, DjangoModelPermissions
from persona.filters import PersonaFilter
from persona.models import Persona
... ... @@ -12,5 +12,5 @@ class PersonaViewSet(viewsets.ModelViewSet):
serializer_class = PersonaSerializer
filterset_class = PersonaFilter
filter_backends = [DjangoFilterBackend]
permission_classes = (IsAuthenticated,)
permission_classes = (IsAuthenticated, DjangoModelPermissions)
... ...
... ... @@ -30,6 +30,5 @@ class Agente(Persona):
identificador = models.UUIDField(default=uuid.uuid4, unique=True, editable=False)
def __str__(self):
return f'{self.identificador}'
... ...