mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-17 06:19:24 +08:00
Improved CustomUserSerializer
This commit is contained in:
parent
5840d3f95c
commit
1e83f74217
2 changed files with 2 additions and 1 deletions
|
@ -16,7 +16,7 @@ class CustomUserSerializer(BaseUserSerializer):
|
||||||
|
|
||||||
class Meta(BaseUserSerializer.Meta):
|
class Meta(BaseUserSerializer.Meta):
|
||||||
model = CustomUser
|
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')
|
'student_id_number', 'year_level', 'semester', 'course', 'subjects', 'avatar', 'first_name', 'last_name', 'is_banned', 'user_status')
|
||||||
|
|
||||||
# The model from your custom user
|
# The model from your custom user
|
||||||
|
|
|
@ -142,6 +142,7 @@ DJOSER = {
|
||||||
'USER_AUTHENTICATION_RULES': ['djoser.authentication.TokenAuthenticationRule'],
|
'USER_AUTHENTICATION_RULES': ['djoser.authentication.TokenAuthenticationRule'],
|
||||||
'SERIALIZERS': {
|
'SERIALIZERS': {
|
||||||
'user': 'accounts.serializers.CustomUserSerializer',
|
'user': 'accounts.serializers.CustomUserSerializer',
|
||||||
|
'current_user': 'accounts.serializers.CustomUserSerializer',
|
||||||
'user_create': 'accounts.serializers.UserRegistrationSerializer',
|
'user_create': 'accounts.serializers.UserRegistrationSerializer',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue