Skip to content

Commit

Permalink
add decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
skoulouzis committed Sep 8, 2023
1 parent ffeddee commit 6992897
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vreapis/workflows/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class WorkflowViewSet(GetSerializerMixin,
mixins.UpdateModelMixin,
mixins.ListModelMixin,
viewsets.GenericViewSet):
authentication_classes = [TokenAuthentication] # Add Token Authentication
permission_classes = [IsAuthenticated] # Add permission for authenticated users
# authentication_classes = [TokenAuthentication] # Add Token Authentication
# permission_classes = [IsAuthenticated] # Add permission for authenticated users
queryset = models.Workflow.objects.all()
serializer_class = serializers.WorkflowSerializer
serializer_action_classes = {
Expand Down Expand Up @@ -106,6 +106,8 @@ def list(self, request, *args, **kwargs):

return super().list(self, request, *args, **kwargs)

@authentication_classes([TokenAuthentication])
@permission_classes([IsAuthenticated])
@action(detail=False, methods=['POST'], name='Submit a workflow')
def submit(self, request, *args, **kwargs):
logger.debug('----------------submit-------------------------')
Expand Down

0 comments on commit 6992897

Please sign in to comment.