|
@@ -2143,13 +2143,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']
|
|
@@ -2330,10 +2329,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
|