Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #196

Merged
merged 23 commits into from
Oct 15, 2024
Merged

Dev #196

Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5a48d49
refactor: accounts/views.py 수정 - 토큰 임포트 삭제
devnproyj22 Oct 6, 2024
1b7d27f
refactor: accounts/views.py 수정 - Not Found 임포트 삭제
devnproyj22 Oct 6, 2024
2a3acc7
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 7, 2024
d246548
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 9, 2024
0ad20a2
refactor: accounts/serializers.py - fields를 __all__ 말고 필드들 나열
devnproyj22 Oct 10, 2024
6276811
refactor: accounts/serializers.py 수정 - 시리얼라이저 필드 추가(시리얼라이저 중첩
devnproyj22 Oct 10, 2024
90a2aa7
Merge branch 'dev' into yujeong/accounts
devnproyj22 Oct 10, 2024
63eafce
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 10, 2024
88945a1
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 10, 2024
49a5a3a
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 10, 2024
99776bc
Merge branch 'yujeong/accounts' of https://github.com/weaverse-techti…
devnproyj22 Oct 10, 2024
7829887
refactor: README.md
devnproyj22 Oct 14, 2024
67350f7
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 14, 2024
5c48dde
와이어프레임 이미지
devnproyj22 Oct 14, 2024
c1b941d
feat: 영상 추가
Yoo117 Oct 14, 2024
b9809ff
chore: 로그인,로그아웃,강의조회 git 업로드
AlbertImKr Oct 15, 2024
fec4580
Merge pull request #195 from weaverse-techtide/194
AlbertImKr Oct 15, 2024
31b64bb
발표
devnproyj22 Oct 15, 2024
cd775eb
Merge branch 'dev' of https://github.com/weaverse-techtide/weaverse-b…
devnproyj22 Oct 15, 2024
ad775f4
발표 자료(2)
devnproyj22 Oct 15, 2024
0a2339f
발표 자료(3)
devnproyj22 Oct 15, 2024
10dcd50
발표자료 (4)
devnproyj22 Oct 15, 2024
a31273b
Merge pull request #188 from weaverse-techtide/yujeong/accounts
AlbertImKr Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: accounts/serializers.py - fields를 __all__ 말고 필드들 나열
  • Loading branch information
devnproyj22 committed Oct 10, 2024
commit 0ad20a2492c9d2ca9ab73753820637aed3127751
34 changes: 32 additions & 2 deletions accounts/serializers.py
Original file line number Diff line number Diff line change
@@ -129,12 +129,28 @@ class CustomUserDetailSerializer(serializers.ModelSerializer):

class Meta:
model = CustomUser
fields = "__all__"
fields = [
"id",
"email",
"nickname",
"password",
"confirm_password",
"is_active",
"is_staff",
"is_superuser",
"students",
"user_type",
"student_count",
"tutor_count",
"created_at",
"updated_at",
]
read_only_fields = [
"id",
"is_active",
"is_staff",
"tutor",
"is_superuser",
"students",
"user_type",
"student_count",
"tutor_count",
@@ -209,6 +225,20 @@ def validate_password(self, value):
)
return value

def validate_nickname(self, value):
"""
닉네임 필드의 데이터를 검증합니다.
"""
if (
CustomUser.objects.filter(nickname=value)
.exclude(id=self.instance.id if self.instance else None)
.exists()
):
raise serializers.ValidationError(
{"nickname": "이미 존재하는 닉네임입니다."}
)
return value

def validate(self, data):
"""
전체 필드에 대한 데이터를 검증합니다.