From 69c699aebb44728e1e045a039d95435c1e1c40c1 Mon Sep 17 00:00:00 2001 From: youngS Date: Tue, 7 Sep 2021 21:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AA=E8=83=BD=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E4=B8=A4=E4=B8=AA=E7=94=A8=E6=88=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/migrations/0006_auto_20210907_2100.py | 26 +++++++++++++++++++ fir_ser/api/models.py | 5 ++-- fir_ser/requirements.txt | 1 + 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 fir_ser/api/migrations/0006_auto_20210907_2100.py diff --git a/fir_ser/api/migrations/0006_auto_20210907_2100.py b/fir_ser/api/migrations/0006_auto_20210907_2100.py new file mode 100644 index 0000000..635bd9e --- /dev/null +++ b/fir_ser/api/migrations/0006_auto_20210907_2100.py @@ -0,0 +1,26 @@ +# Generated by Django 3.2.3 on 2021-09-07 21:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('api', '0005_thirdwechatuserinfo'), + ] + + operations = [ + migrations.RemoveField( + model_name='userinfo', + name='qq', + ), + migrations.AlterField( + model_name='userinfo', + name='email', + field=models.EmailField(blank=True, db_index=True, max_length=255, null=True, verbose_name='email address'), + ), + migrations.AlterField( + model_name='userinfo', + name='mobile', + field=models.BigIntegerField(db_index=True, help_text='用于手机验证码登录', null=True, verbose_name='手机'), + ), + ] diff --git a/fir_ser/api/models.py b/fir_ser/api/models.py index 220e948..4b8b79b 100644 --- a/fir_ser/api/models.py +++ b/fir_ser/api/models.py @@ -16,13 +16,12 @@ class UserInfo(AbstractUser): email = models.EmailField( verbose_name='email address', max_length=255, - unique=True, + db_index=True, blank=True, null=True ) uid = models.CharField(max_length=64, unique=True, db_index=True) # user_id,唯一标识 - mobile = models.BigIntegerField(verbose_name="手机", unique=True, help_text="用于手机验证码登录", null=True) - qq = models.BigIntegerField(verbose_name="QQ", blank=True, null=True, db_index=True) + mobile = models.BigIntegerField(verbose_name="手机", db_index=True, help_text="用于手机验证码登录", null=True) is_active = models.BooleanField(default=True, verbose_name="账户状态,默认启用") storage_active = models.BooleanField(default=False, verbose_name="配置存储,默认关闭") supersign_active = models.BooleanField(default=True, verbose_name="配置超级签,默认关闭") diff --git a/fir_ser/requirements.txt b/fir_ser/requirements.txt index db40a6b..f2fe256 100644 --- a/fir_ser/requirements.txt +++ b/fir_ser/requirements.txt @@ -3,6 +3,7 @@ django-celery-results==2.0.1 django-celery-beat==2.2.0 Django==3.2.3 djangorestframework==3.12.4 +djangorestframework-xml==2.0.0 django-simple-captcha==0.5.14 mysqlclient==2.0.3 django-redis==4.12.1