|
@@ -3644,7 +3644,7 @@ def delete_local_account(username):
|
|
|
|
|
|
|
|
|
|
def updateUserCountry(request):
|
|
def updateUserCountry(request):
|
|
- country_ip_qs = CountryIPModel.objects.filter()
|
|
|
|
|
|
+ country_ip_qs = CountryIPModel.objects.filter(status=0)
|
|
if country_ip_qs.exists():
|
|
if country_ip_qs.exists():
|
|
country_ip_qs = country_ip_qs[0: 100].values()
|
|
country_ip_qs = country_ip_qs[0: 100].values()
|
|
ids = []
|
|
ids = []
|
|
@@ -3658,8 +3658,9 @@ def updateUserCountry(request):
|
|
country = CommonService.getAddr(country_ip['ip'])
|
|
country = CommonService.getAddr(country_ip['ip'])
|
|
redisObject.set_data(key=key, val=country, expire=3600)
|
|
redisObject.set_data(key=key, val=country, expire=3600)
|
|
|
|
|
|
- UserExModel.objects.filter(id=country_ip['user_ex_id']).update(country=country)
|
|
|
|
- ids.append(country_ip['id'])
|
|
|
|
- CountryIPModel.objects.filter(id__in=tuple(ids)).delete()
|
|
|
|
|
|
+ country_ip['country'] = country
|
|
|
|
+ CountryIPModel.objects.filter(id=country_ip['id']).update(country=country, status=1)
|
|
|
|
+ # ids.append(country_ip['id'])
|
|
|
|
+ # CountryIPModel.objects.filter(id__in=tuple(ids)).update(status=1)
|
|
response = ResponseObject()
|
|
response = ResponseObject()
|
|
return response.json(0)
|
|
return response.json(0)
|