v0.0.31 | 비밀번호 변경 기능 추가
All checks were successful
Build And Test / build-and-push (push) Successful in 3m38s
All checks were successful
Build And Test / build-and-push (push) Successful in 3m38s
- ChangePasswordView API 추가 (사용자 본인 비밀번호 변경) - 소셜 로그인 계정 비밀번호 설정 지원 - 관리자 비밀번호 초기화 기능 (UserUpdateView) - RegisterSerializer에 has_password 필드 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -5,13 +5,18 @@ from rest_framework.exceptions import ValidationError
|
||||
|
||||
class RegisterSerializer(serializers.ModelSerializer):
|
||||
password = serializers.CharField(write_only=True, required=False)
|
||||
has_password = serializers.SerializerMethodField()
|
||||
|
||||
class Meta:
|
||||
model = CustomUser
|
||||
fields = ("email", "name", "password", "grade", "desc",
|
||||
"phone", "address", "gender", "birth_date", "education",
|
||||
"social_provider", "profile_image")
|
||||
read_only_fields = ("social_provider", "profile_image")
|
||||
"social_provider", "profile_image", "has_password")
|
||||
read_only_fields = ("social_provider", "profile_image", "has_password")
|
||||
|
||||
def get_has_password(self, obj):
|
||||
"""사용자가 비밀번호를 가지고 있는지 여부"""
|
||||
return obj.has_usable_password()
|
||||
|
||||
def validate_email(self, value):
|
||||
if CustomUser.objects.filter(email=value).exists():
|
||||
|
||||
Reference in New Issue
Block a user