Skip to content

Commit

Permalink
all removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvyshnevska committed Apr 9, 2024
1 parent fcde904 commit 0e70f72
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions administration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class UserDetailView(RetrieveUpdateDestroyAPIView):

permission_classes = [IsStaffUser]
serializer_class = AdminUserDetailSerializer
queryset = CustomUser.objects.all().select_related("profile")
queryset = CustomUser.objects.select_related("profile")

def destroy(self, request, *args, **kwargs):
instance = self.get_object()
Expand All @@ -64,8 +64,7 @@ class ProfilesListView(ListCreateAPIView):
pagination_class = ListPagination
serializer_class = AdminCompanyListSerializer
queryset = (
Profile.objects.all()
.select_related("person")
Profile.objects.select_related("person")
.prefetch_related("regions", "categories", "activities")
.order_by("id")
)
Expand All @@ -78,8 +77,6 @@ class ProfileDetailView(RetrieveUpdateDestroyAPIView):

permission_classes = [IsStaffUser]
serializer_class = AdminCompanyDetailSerializer
queryset = (
Profile.objects.all()
.select_related("person")
.prefetch_related("regions", "categories", "activities")
queryset = Profile.objects.select_related("person").prefetch_related(
"regions", "categories", "activities"
)

0 comments on commit 0e70f72

Please sign in to comment.