stash
This commit is contained in:
parent
8d55b00027
commit
ea27165e25
13 changed files with 162 additions and 34 deletions
|
@ -1,8 +1,10 @@
|
|||
import logging
|
||||
|
||||
from django.urls import path
|
||||
from rest_framework.decorators import api_view, permission_classes, authentication_classes
|
||||
from django.contrib.auth.decorators import permission_required
|
||||
from rest_framework import routers, viewsets, serializers, status
|
||||
from rest_framework.decorators import api_view, permission_classes
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from asgiref.sync import async_to_sync
|
||||
|
||||
|
@ -56,6 +58,8 @@ class IssueViewSet(viewsets.ModelViewSet):
|
|||
|
||||
|
||||
@api_view(['POST'])
|
||||
@permission_classes([IsAuthenticated])
|
||||
@permission_required('tickets.add_issuethread', raise_exception=True)
|
||||
def reply(request, pk):
|
||||
issue = IssueThread.objects.get(pk=pk)
|
||||
# email = issue.reply(request.data['body']) # TODO evaluate if this is a useful abstraction
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue