From 35fe1ae590051f26a9b2bfdc3cde1aa2aef7480d Mon Sep 17 00:00:00 2001 From: Maxim Kukhtenkov Date: Mon, 17 Oct 2016 10:27:03 -0700 Subject: [PATCH] Return `pk` in /rest-auth/user/ instead of `id` --- rest_auth/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_auth/serializers.py b/rest_auth/serializers.py index 6157f37..a2c11ad 100644 --- a/rest_auth/serializers.py +++ b/rest_auth/serializers.py @@ -126,7 +126,7 @@ class UserDetailsSerializer(serializers.ModelSerializer): """ class Meta: model = UserModel - fields = ('id', 'username', 'email', 'first_name', 'last_name') + fields = ('pk', 'username', 'email', 'first_name', 'last_name') read_only_fields = ('email', )