From 17499a12c9216d1db907305ef30f58970cd0932e Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:33:27 -0500 Subject: [PATCH 1/2] Remove email from User API --- .../{{cookiecutter.project_slug}}/users/api/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py index 8bd39d30..b5ccabba 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py @@ -7,7 +7,7 @@ User = get_user_model() class UserSerializer(serializers.ModelSerializer): class Meta: model = User - fields = ["username", "email", "name", "url"] + fields = ["username", "name", "url"] extra_kwargs = { "url": {"view_name": "api:user-detail", "lookup_field": "username"} From 8aeee881bb32935718e767114256179f9c9bf216 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:35:47 -0500 Subject: [PATCH 2/2] Remove email from User API Test --- .../{{cookiecutter.project_slug}}/users/tests/test_drf_views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py index 60944ad3..92457308 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py @@ -28,7 +28,6 @@ class TestUserViewSet: assert response.data == { "username": user.username, - "email": user.email, "name": user.name, "url": f"http://testserver/api/users/{user.username}/", }