2023-06-26 19:45:58 +08:00
|
|
|
from djoser.serializers import UserCreateSerializer as BaseUserRegistrationSerializer
|
|
|
|
from djoser.serializers import UserSerializer as BaseUserSerializer
|
|
|
|
from accounts.models import CustomUser
|
|
|
|
|
|
|
|
|
|
|
|
class CustomUserSerializer(BaseUserSerializer):
|
|
|
|
class Meta(BaseUserSerializer.Meta):
|
|
|
|
model = CustomUser
|
|
|
|
fields = '__all__'
|
|
|
|
|
|
|
|
|
|
|
|
class UserRegistrationSerializer(BaseUserRegistrationSerializer):
|
|
|
|
class Meta(BaseUserRegistrationSerializer.Meta):
|
2023-06-26 20:36:58 +08:00
|
|
|
fields = ('username', 'email', 'password',
|
2023-06-26 21:39:59 +08:00
|
|
|
'is_student', 'student_id_number', 'year_level', 'semester', 'avatar')
|