Remove email from User API

This commit is contained in:
Andrew Chen Wang 2021-02-16 18:33:27 -05:00 committed by GitHub
parent 0d5e9132f7
commit 17499a12c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ User = get_user_model()
class UserSerializer(serializers.ModelSerializer): class UserSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = User model = User
fields = ["username", "email", "name", "url"] fields = ["username", "name", "url"]
extra_kwargs = { extra_kwargs = {
"url": {"view_name": "api:user-detail", "lookup_field": "username"} "url": {"view_name": "api:user-detail", "lookup_field": "username"}