فهرست منبع

修改赋值方式

locky 2 سال پیش
والد
کامیت
0b77c6dda5
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 2 1
      Controller/DetectControllerV2.py
  2. 2 1
      Service/DevicePushService.py

+ 2 - 1
Controller/DetectControllerV2.py

@@ -98,7 +98,8 @@ class NotificationV2View(View):
             if not uid_push_qs.exists():
                 logger.info('消息推送-{}uid_push数据不存在'.format(uid))
                 return JsonResponse(status=200, data={'code': 176, 'msg': 'no uid_push data'})
-            ai_type, device_type = uid_push_qs.first()['uid_set__ai_type'], uid_push_qs.first()['uid_set__device_type']
+            ai_type = uid_push_qs.first()['uid_set__ai_type']
+            device_type = uid_push_qs.first()['uid_set__device_type']
             logger.info('ai_type: {}, device_type: {}'.format(ai_type, device_type))
             # 将uid_set以及uid_push 转数组列表
             uid_set_push_list = DevicePushService.cache_uid_push(uid_push_qs)

+ 2 - 1
Service/DevicePushService.py

@@ -330,7 +330,8 @@ class DevicePushService:
         """
         n_date = CommonService.get_now_time_str(n_time=n_time, tz=tz, lang=lang)
         msg_type = ''
-        event_type, device_type = int(event_type), int(device_type)
+        event_type = int(event_type)
+        device_type = int(device_type)
         if lang == 'cn':
             if event_type == 704:
                 msg_type = '剩余电量 ' + electricity