Skip to content

Conversation

RandomProgramm3r
Copy link
Owner

  • Implemented UserProfileSerializer to handle partial updates:
    • Omits avatar_url from output when it’s empty or null
    • Hashes new passwords with set_password() without incrementing token_version (tokens remain valid)
  • Created UserProfileView (RetrieveUpdateAPIView) with IsAuthenticated permission
    • GET /user/profile returns current user’s data
    • PATCH /user/profile applies only provided fields
  • Registered route path('user/profile', UserProfileView.as_view())

- Implemented `UserProfileSerializer` to handle partial updates:
  - Omits `avatar_url` from output when it’s empty or null
  - Hashes new passwords with `set_password()` without incrementing `token_version` (tokens remain valid)
- Created `UserProfileView` (RetrieveUpdateAPIView) with `IsAuthenticated` permission
  - `GET /user/profile` returns current user’s data
  - `PATCH /user/profile` applies only provided fields
- Registered route `path('user/profile', UserProfileView.as_view())`
@RandomProgramm3r RandomProgramm3r merged commit cc8a467 into main May 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant