Browse Source

查询域名日志数据过滤country_code为空数据,默认country_code保存为N/A

locky 1 năm trước cách đây
mục cha
commit
557ea9dcca

+ 2 - 1
AdminController/LogManagementController.py

@@ -3,6 +3,7 @@
 import boto3
 import botocore
 import requests
+from django.db.models import Q
 from django.views.generic.base import View
 
 from Object.IPWeatherObject import IPQuery
@@ -426,7 +427,7 @@ class LogManagementView(View):
         line = int(page_size)
 
         try:
-            device_domain_qs = DeviceDomainRegionModel.objects.all()
+            device_domain_qs = DeviceDomainRegionModel.objects.filter(~Q(country_code=''))
             if serial_number:
                 device_domain_qs = device_domain_qs.filter(serial_number__contains=serial_number)
             count = device_domain_qs.count()

+ 2 - 2
Controller/DeviceConfirmRegion.py

@@ -122,11 +122,11 @@ class ConfirmRegionV2(View):
                         push_region = get_push_region(api)
                     else:
                         # 返回美洲域名
-                        data_dict['country_code'] = 'NA'
+                        data_dict['country_code'] = 'N/A'
                         api, push_api, region_id, push_region = get_default_api()
             else:
                 # 返回美洲域名
-                data_dict['country_code'] = 'NA'
+                data_dict['country_code'] = 'N/A'
                 api, push_api, region_id, push_region = get_default_api()
 
             # 更新或创建设备域名数据