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>
14 lines
423 B
Python
14 lines
423 B
Python
import re
|
|
|
|
with open('users/models.py', 'r') as f:
|
|
content = f.read()
|
|
|
|
new_content = re.sub(
|
|
r'is_premium = models.BooleanField\(default=False, verbose_name=_\("Premium Status"\)\)',
|
|
'is_premium = models.BooleanField(default=False, verbose_name=_("Premium Status"))\n bio = models.TextField(blank=True, verbose_name=_("Bio"))',
|
|
content
|
|
)
|
|
|
|
with open('users/models.py', 'w') as f:
|
|
f.write(new_content)
|