UserDevice.is_active 改名为 is_bound(消除与 Device.is_active 的命名冲突), 新增 ActiveUserDeviceManager(active manager),4 处控制权解析调用点 (MAC 登录、bind_status、绑定校验、RTC token、绑定 endpoint)切换到 UserDevice.active.filter(...),避免 P2 软删后旧绑定者被签发 user-token、 WS 分组路由错误、RTC 房间归属错乱等安全 / 越权风险。 base_manager_name='objects' 保证 admin 默认 queryset 不受 active 过滤影响。 详见 docs/REVIEW-affinity-P1.md CR-001 / IN-005。
18 lines
504 B
Python
18 lines
504 B
Python
# Generated by Django 5.2.12 on 2026-05-13 02:09
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('device_interaction', '0004_rename_userdevice_is_active_is_bound'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AlterModelOptions(
|
|
name='userdevice',
|
|
options={'base_manager_name': 'objects', 'ordering': ['-bound_at'], 'verbose_name': '用户设备', 'verbose_name_plural': '用户设备'},
|
|
),
|
|
]
|