Improved CustomUserSerializer

This commit is contained in:
Keannu Bernasol 2023-07-04 20:34:12 +08:00
parent 5840d3f95c
commit 1e83f74217
2 changed files with 2 additions and 1 deletions

View file

@ -16,7 +16,7 @@ class CustomUserSerializer(BaseUserSerializer):
class Meta(BaseUserSerializer.Meta):
model = CustomUser
fields = ('username', 'email', 'password',
fields = ('username', 'email',
'student_id_number', 'year_level', 'semester', 'course', 'subjects', 'avatar', 'first_name', 'last_name', 'is_banned', 'user_status')
# The model from your custom user

View file

@ -142,6 +142,7 @@ DJOSER = {
'USER_AUTHENTICATION_RULES': ['djoser.authentication.TokenAuthenticationRule'],
'SERIALIZERS': {
'user': 'accounts.serializers.CustomUserSerializer',
'current_user': 'accounts.serializers.CustomUserSerializer',
'user_create': 'accounts.serializers.UserRegistrationSerializer',
},
}