Parcourir la source

优化新增推送信息逻辑

peng il y a 2 ans
Parent
commit
754b4ff807
1 fichiers modifiés avec 8 ajouts et 11 suppressions
  1. 8 11
      Controller/UserController.py

+ 8 - 11
Controller/UserController.py

@@ -2142,13 +2142,12 @@ class v3LoginView(TemplateView):
         lang = request_dict.get('lang', 'en')
         tz = request_dict.get('tz', None)
         if all([app_bundle_id, app_type, push_type, token_val, m_code, tz]):
-            if 'loocam' in app_bundle_id:
-                gateway_push_qs = GatewayPush.objects.filter(user_id=userID, m_code=m_code)
-                if gateway_push_qs.exists():
-                    gateway_push_qs.update(token_val=token_val, push_type=push_type, logout=False)
-                else:
-                    GatewayPush.objects.create(user_id=userID, app_bundle_id=app_bundle_id, app_type=app_type,
-                                               push_type=push_type, token_val=token_val, m_code=m_code, lang=lang, tz=tz)
+            gateway_push_qs = GatewayPush.objects.filter(user_id=userID, m_code=m_code)
+            if gateway_push_qs.exists():
+                gateway_push_qs.update(token_val=token_val, push_type=push_type, logout=False)
+            else:
+                GatewayPush.objects.create(user_id=userID, app_bundle_id=app_bundle_id, app_type=app_type,
+                                           push_type=push_type, token_val=token_val, m_code=m_code, lang=lang, tz=tz)
             UidPushModel.objects.filter(userID=userID, m_code=m_code).update(token_val=token_val, push_type=push_type)
         now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
         region_country = users['region_country']
@@ -2329,10 +2328,8 @@ class InitInfoView(View):
         if m_code[:4] == 'iOS_':
             m_code = m_code[4:]
         if all([token_val, push_type, appBundleId, userID]):
-            if 'loocam' in appBundleId:
-                self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
-            if 'loocam' not in appBundleId:
-                self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time)
+            self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
+            self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time)
             if appBundleId:
                 user_ex_qs = UserExModel.objects.filter(userID_id=userID)
                 user_ex = None