make User.last_login read_only=True in its serializer

This commit is contained in:
Ryan Petrello
2020-03-13 12:53:40 -04:00
parent 6b20ffbfdd
commit 27b48fe55b
2 changed files with 16 additions and 0 deletions

View File

@@ -884,6 +884,9 @@ class UserSerializer(BaseSerializer):
fields = ('*', '-name', '-description', '-modified',
'username', 'first_name', 'last_name',
'email', 'is_superuser', 'is_system_auditor', 'password', 'ldap_dn', 'last_login', 'external_account')
extra_kwargs = {
'last_login': {'read_only': True}
}
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)