- Update food, outfits, props, home-decor pages and components - Add permissions page and sidebar updates - Update API client and all API modules (auth, food, dances, etc.) - Add card model migrations for optional fields - Update Django views, serializers, and authentication - Add affinity level migrations and user app updates - Add project documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
服务器端代码修改记录
本文档记录每次对服务器端代码的修改,方便追踪变更历史。
修改格式说明
每次修改按以下格式记录:
### [日期] 修改简述
- **文件路径**: 相对于项目根目录的文件路径
- **修改类型**: 新增 / 修改 / 删除 / 重构 / 修复Bug
- **修改内容**: 具体修改了什么
- **修改原因**: 为什么要做这个修改
修改历史
[2026-03-17] 修复手机号登录时 IntegrityError
- 文件路径:
userapp/views.py - 修改类型: 修复Bug
- 修改内容:
PhoneLoginView.post()中get_or_create新增defaults={'username': phone_number} - 修改原因: 新用户首次通过手机号登录时,
get_or_create未设置username字段,导致username=""与数据库中已有空 username 记录冲突,触发IntegrityError: duplicate key value violates unique constraint "userapp_paradiseuser_username_key"。改为用手机号作为默认 username,保证唯一性。