Showing
2 changed files
with
3 additions
and
4 deletions
1 | from django_filters.rest_framework import DjangoFilterBackend | 1 | from django_filters.rest_framework import DjangoFilterBackend |
2 | -from rest_framework import viewsets, filters | ||
3 | -from rest_framework.permissions import IsAuthenticated | 2 | +from rest_framework import viewsets |
3 | +from rest_framework.permissions import IsAuthenticated, DjangoModelPermissions | ||
4 | 4 | ||
5 | from persona.filters import PersonaFilter | 5 | from persona.filters import PersonaFilter |
6 | from persona.models import Persona | 6 | from persona.models import Persona |
@@ -12,5 +12,5 @@ class PersonaViewSet(viewsets.ModelViewSet): | @@ -12,5 +12,5 @@ class PersonaViewSet(viewsets.ModelViewSet): | ||
12 | serializer_class = PersonaSerializer | 12 | serializer_class = PersonaSerializer |
13 | filterset_class = PersonaFilter | 13 | filterset_class = PersonaFilter |
14 | filter_backends = [DjangoFilterBackend] | 14 | filter_backends = [DjangoFilterBackend] |
15 | - permission_classes = (IsAuthenticated,) | 15 | + permission_classes = (IsAuthenticated, DjangoModelPermissions) |
16 | 16 |
@@ -30,6 +30,5 @@ class Agente(Persona): | @@ -30,6 +30,5 @@ class Agente(Persona): | ||
30 | 30 | ||
31 | identificador = models.UUIDField(default=uuid.uuid4, unique=True, editable=False) | 31 | identificador = models.UUIDField(default=uuid.uuid4, unique=True, editable=False) |
32 | 32 | ||
33 | - | ||
34 | def __str__(self): | 33 | def __str__(self): |
35 | return f'{self.identificador}' | 34 | return f'{self.identificador}' |
-
Please register or login to post a comment