mirror of
https://github.com/lemeow125/Borrowing-TrackerBackend.git
synced 2025-04-27 10:11:24 +08:00
Add clearance viewset for student
This commit is contained in:
parent
5c8a99675d
commit
372e466744
5 changed files with 56 additions and 9 deletions
|
@ -15,8 +15,7 @@ class TransactionViewSet(viewsets.ModelViewSet):
|
|||
|
||||
|
||||
class TransactionByStudentViewSet(generics.ListAPIView):
|
||||
# Only allow GET, POST/CREATE
|
||||
# Transactions cannot be deleted
|
||||
# Viewset for GET only
|
||||
http_method_names = ['get']
|
||||
permission_classes = [IsAuthenticated, IsStudent]
|
||||
serializer_class = TransactionSerializer
|
||||
|
@ -29,8 +28,7 @@ class TransactionByStudentViewSet(generics.ListAPIView):
|
|||
|
||||
|
||||
class TransactionByTeacherViewSet(generics.ListAPIView):
|
||||
# Only allow GET, POST/CREATE
|
||||
# Transactions cannot be deleted
|
||||
# Viewset for GET only
|
||||
http_method_names = ['get']
|
||||
permission_classes = [IsAuthenticated, IsTeacher]
|
||||
serializer_class = TransactionSerializer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue