Эх сурвалжийг харах

优化新增推送信息逻辑

peng 2 жил өмнө
parent
commit
6d8abd949b

+ 8 - 11
Controller/UserController.py

@@ -2143,13 +2143,12 @@ class v3LoginView(TemplateView):
         lang = request_dict.get('lang', 'en')
         lang = request_dict.get('lang', 'en')
         tz = request_dict.get('tz', None)
         tz = request_dict.get('tz', None)
         if all([app_bundle_id, app_type, push_type, token_val, m_code, tz]):
         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)
             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)
         now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
         region_country = users['region_country']
         region_country = users['region_country']
@@ -2330,10 +2329,8 @@ class InitInfoView(View):
         if m_code[:4] == 'iOS_':
         if m_code[:4] == 'iOS_':
             m_code = m_code[4:]
             m_code = m_code[4:]
         if all([token_val, push_type, appBundleId, userID]):
         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:
             if appBundleId:
                 user_ex_qs = UserExModel.objects.filter(userID_id=userID)
                 user_ex_qs = UserExModel.objects.filter(userID_id=userID)
                 user_ex = None
                 user_ex = None