Skip to content

Commit

Permalink
Fix user-detail URL resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
aapris authored Oct 25, 2023
1 parent fa99ae6 commit df4df4d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mittaridatapumppu-deviceregistry/devices/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet):

queryset = User.objects.all().order_by("-date_joined")
lookup_field = "username" # Use username instead of pk
lookup_value_regex = r"[\w.@+-]+" # Allow dots in username
serializer_class = UserSerializer
permission_classes = [permissions.DjangoModelPermissions]
authentication_classes = [
Expand Down

0 comments on commit df4df4d

Please sign in to comment.