From 4c3a6552399cca20040fc7fecb764516daa403da Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 8 Dec 2020 20:51:02 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=94=A8=E6=88=B7=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E7=B1=BB=E7=A6=81=E6=AD=A2=E4=BF=AE=E6=94=B9source=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/serializers/user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index e59467173..1e50c1107 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -68,6 +68,10 @@ class UserSerializer(CommonBulkSerializerMixin, serializers.ModelSerializer): 'can_update', 'can_delete', 'login_blocked', 'org_roles' ] + read_only_fields = [ + 'date_joined', 'last_login', 'created_by', 'is_first_login', 'source' + ] + extra_kwargs = { 'password': {'write_only': True, 'required': False, 'allow_null': True, 'allow_blank': True}, 'public_key': {'write_only': True},