Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working to main #166

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mooringlicensing/components/users/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,17 @@ class UserListFilterView(generics.ListAPIView):


class UserViewSet(viewsets.ModelViewSet):
queryset = EmailUser.objects.all()
queryset = EmailUser.objects.none()
serializer_class = UserSerializer

def get_queryset(self):
if is_internal(self.request):
return EmailUser.objects.all()
elif is_customer(self.request):
user = self.request.user
return EmailUser.objects.filter(Q(id=user.id))
return EmailUser.objects.none()

@detail_route(methods=['POST',], detail=True)
@basic_exception_handler
def update_personal(self, request, *args, **kwargs):
Expand Down
Loading