Skip to content

Commit

Permalink
Update update_register.py
Browse files Browse the repository at this point in the history
Door niet de hele modelviewset vanuit rest framework in te laden maar alleen de GenericViewSet en de CreateModelMixin kun je afvangen dat alleen een post mogelijk is zonder zelf permissions te moeten schrijven.
  • Loading branch information
mattijsstam authored Jul 5, 2022
1 parent bc2c8ce commit d050124
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/holon/viewsets/update_register.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from holon.models import UpdateRegister
from holon.serializers import UpdateRegisterSerializer
from rest_framework import viewsets, permissions
from holon.permissions import AllowOnlyPost
from rest_framework import viewsets, mixins

# ViewSets define the view behavior.
class UpdateRegisterViewSet(viewsets.ModelViewSet):
class UpdateRegisterViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet):
queryset = UpdateRegister.objects.all()
serializer_class = UpdateRegisterSerializer
permission_classes = [AllowOnlyPost]

0 comments on commit d050124

Please sign in to comment.