Skip to content

Commit

Permalink
Merge branch 'develop' into test-api
Browse files Browse the repository at this point in the history
  • Loading branch information
theyashshahs authored Oct 4, 2020
2 parents 29151c3 + b94a863 commit fbfba14
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
'rest_framework.permissions.IsAuthenticated'
]
}

Expand Down
4 changes: 3 additions & 1 deletion contact_us/views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from rest_framework.viewsets import ModelViewSet
from contact_us.models import Contact
from contact_us.serializers import ContactSerializers

from rest_framework.decorators import permission_classes
from rest_framework.permissions import IsAuthenticated
class ContactViewSets(ModelViewSet):
permission_classes = [IsAuthenticated]
serializer_class = ContactSerializers
queryset = Contact.objects.all()

Expand Down
4 changes: 3 additions & 1 deletion contribute/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from rest_framework.viewsets import ModelViewSet
from contribute.models import Contribute
from contribute.serializers import ContributeSerializers

from rest_framework.decorators import permission_classes
from rest_framework.permissions import IsAuthenticated
class ContributeViewSets(ModelViewSet):
permission_classes=[IsAuthenticated]
serializer_class = ContributeSerializers
queryset = Contribute.objects.all()
8 changes: 8 additions & 0 deletions course/views.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
from rest_framework.viewsets import ModelViewSet
from course.models import Course, Assignment, ExamPaper, VideoLecture
from course.serializers import CourseSerializers, AssignmentSerializers, ExamPaperSerializers, VideoLectureSerializers
from rest_framework.decorators import permission_classes
from rest_framework.permissions import IsAuthenticated
from course.models import Course, Assignment, ExamPaper, VideoLecture, Note
from course.serializers import CourseSerializers, AssignmentSerializers, ExamPaperSerializers, VideoLectureSerializers, NoteSerializers

class CourseViewSets(ModelViewSet):
permission_classes =[IsAuthenticated]
serializer_class = CourseSerializers
queryset = Course.objects.all()


class AssignmentViewSets(ModelViewSet):
permission_classes =[IsAuthenticated]
serializer_class = AssignmentSerializers
queryset = Assignment.objects.all()


class ExamPaperViewSets(ModelViewSet):
permission_classes =[IsAuthenticated]
serializer_class = ExamPaperSerializers
queryset = ExamPaper.objects.all()


class VideoLectureViewSets(ModelViewSet):
permission_classes =[IsAuthenticated]
serializer_class = VideoLectureSerializers
queryset = VideoLecture.objects.all()

Expand Down
3 changes: 3 additions & 0 deletions semester/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
from rest_framework.viewsets import ModelViewSet
from semester.models import Semester
from semester.serializers import SemesterSerializers
from rest_framework.decorators import permission_classes
from rest_framework.permissions import IsAuthenticated


class SemesterViewSets(ModelViewSet):
permission_classes =[IsAuthenticated]
serializer_class = SemesterSerializers
queryset = Semester.objects.all()

0 comments on commit fbfba14

Please sign in to comment.