small style change
This commit is contained in:
parent
faabb97463
commit
44770d9cbd
@ -14,10 +14,8 @@ def MyIpView(request):
|
|||||||
def UpdateIpView(request):
|
def UpdateIpView(request):
|
||||||
ipaddr = request.META['REMOTE_ADDR']
|
ipaddr = request.META['REMOTE_ADDR']
|
||||||
af = dns.inet.af_for_address(ipaddr)
|
af = dns.inet.af_for_address(ipaddr)
|
||||||
if af == dns.inet.AF_INET:
|
key = 'ipv4' if af == dns.inet.AF_INET else 'ipv6'
|
||||||
request.session['ipv4'] = ipaddr
|
request.session[key] = ipaddr
|
||||||
else:
|
|
||||||
request.session['ipv6'] = ipaddr
|
|
||||||
return HttpResponse('OK', content_type="text/plain")
|
return HttpResponse('OK', content_type="text/plain")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user