mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 04:39:59 +03:00
- Add `bio` (TextField) to `User` model. - Extend `UserProfileAPIView` `patch` method to handle profile updates. - Sanitize `bio` input using `bleach.clean` to prevent XSS. - Validate `username` to allow only alphanumeric characters, underscores, and hyphens. - Add comprehensive test cases in `test_profile_view.py`. - Apply migrations. - Mark relevant items as completed in `.jules/development-plan.md`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Senpai-YoloBot <41898282+github-actions[bot]@users.noreply.github.com>
13 lines
331 B
Python
13 lines
331 B
Python
import re
|
|
|
|
with open('users/views.py', 'r') as f:
|
|
content = f.read()
|
|
|
|
new_content = content.replace(
|
|
"'is_premium': getattr(user, 'is_premium', False),",
|
|
"'is_premium': getattr(user, 'is_premium', False),\n 'bio': getattr(user, 'bio', ''),"
|
|
)
|
|
|
|
with open('users/views.py', 'w') as f:
|
|
f.write(new_content)
|