[Update] Login log 添加display field

pull/3967/head
ibuler 2020-05-06 19:35:19 +08:00
parent 5812c50a33
commit 8c0bf0b71b
1 changed files with 5 additions and 2 deletions

View File

@ -15,11 +15,14 @@ class FTPLogSerializer(serializers.ModelSerializer):
class UserLoginLogSerializer(serializers.ModelSerializer):
type_display = serializers.ReadOnlyField(source='get_type_display')
status_display = serializers.ReadOnlyField(source='get_status_display')
class Meta:
model = models.UserLoginLog
fields = (
'username', 'type', 'ip', 'city', 'user_agent',
'mfa', 'reason', 'status', 'datetime'
'username', 'type', 'type_display', 'ip', 'city', 'user_agent',
'mfa', 'reason', 'status', 'status_display', 'datetime'
)