Skip to content

Commit

Permalink
refactor(users): reduce unnecessary line count
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-o committed Jul 14, 2019
1 parent 5e9eaf3 commit 2f941ad
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions intranet/apps/users/api.py
Expand Up @@ -35,9 +35,7 @@ def retrieve(self, request, *args, **kwargs):
else:
user = request.user

serializer = self.get_serializer(user)
data = serializer.data
return Response(data)
return Response(self.get_serializer(user).data)


class ProfilePictureDetail(generics.RetrieveAPIView):
Expand Down Expand Up @@ -75,8 +73,7 @@ def retrieve(self, request, *args, **kwargs):
default_image_path = os.path.join(settings.PROJECT_ROOT, "static/img/default_profile_pic.png")
binary = io.open(default_image_path, mode="rb").read()

response = Response(binary, content_type="image/jpeg")
return response
return Response(binary, content_type="image/jpeg")


class Search(generics.RetrieveAPIView):
Expand Down

0 comments on commit 2f941ad

Please sign in to comment.