diff --git a/fir_ser/api/migrations/0011_auto_20210125_1137.py b/fir_ser/api/migrations/0011_auto_20210125_1137.py new file mode 100644 index 0000000..e5d967d --- /dev/null +++ b/fir_ser/api/migrations/0011_auto_20210125_1137.py @@ -0,0 +1,22 @@ +# Generated by Django 3.0.3 on 2021-01-25 11:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0010_userinfo_api_token'), + ] + + operations = [ + migrations.RemoveField( + model_name='udidsyncdeveloper', + name='created_time', + ), + migrations.AddField( + model_name='udidsyncdeveloper', + name='platform', + field=models.SmallIntegerField(choices=[(0, 'app developer'), (1, 'fly分发')], default=0, verbose_name='udid所在平台'), + ), + ] diff --git a/fir_ser/api/models.py b/fir_ser/api/models.py index 730bf44..31dc3ad 100644 --- a/fir_ser/api/models.py +++ b/fir_ser/api/models.py @@ -270,7 +270,9 @@ class UDIDsyncDeveloper(models.Model): product = models.CharField(max_length=64, verbose_name="产品", blank=True, null=True, ) serial = models.CharField(max_length=64, verbose_name="序列号", blank=True, null=True, ) version = models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) - created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") + created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间"), + platform_choices = ((0, 'fly分发'), (1, 'app developer'),) + platform = models.SmallIntegerField(choices=platform_choices, default=0, verbose_name="udid所在平台") class Meta: verbose_name = 'iOS开发平台同步设备信息' diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index a5d4a0b..f9bfbfe 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -483,6 +483,7 @@ class IosUtils(object): "get_device_from_developer developer_obj:%s user_obj:%s delete file failed Exception:%s" % ( developer_obj, user_obj, e)) + UDIDsyncDeveloper.objects.filter(developerid=developer_obj, platform=1).delete() for devicestr in devices_info.split(">"): formatdevice = re.findall(r'.*Device id="(.*)",.*name="(.*)",.*udid="(.*?)",.*model=(.*),.*', devicestr) if formatdevice: @@ -491,6 +492,7 @@ class IosUtils(object): "product": formatdevice[0][1], "udid": formatdevice[0][2], "version": formatdevice[0][3], + "platform": 1 } app_udid_obj = UDIDsyncDeveloper.objects.filter(developerid=developer_obj, udid=device.get("udid")) if app_udid_obj: