mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-02-23 06:28:15 +08:00
Follow up hotfix on questionnaire endpoint failing
This commit is contained in:
parent
44796a93f7
commit
84ff7011ea
1 changed files with 8 additions and 1 deletions
|
@ -15,7 +15,14 @@ class QuestionnaireListAPIView(generics.ListAPIView):
|
|||
serializer_class = QuestionnaireSerializer
|
||||
queryset = Questionnaire.objects.all()
|
||||
pagination_class = PageNumberPagination
|
||||
permission_classes = [IsAuthenticated, IsPlanning]
|
||||
permission_classes = [IsAuthenticated]
|
||||
|
||||
def get_queryset(self):
|
||||
user = self.request.user
|
||||
if user.role == "client":
|
||||
return Questionnaire.objects.filter(client=user)
|
||||
else:
|
||||
return Questionnaire.objects.all()
|
||||
|
||||
|
||||
class QuestionnaireSubmitView(generics.CreateAPIView):
|
||||
|
|
Loading…
Reference in a new issue