small style change

This commit is contained in:
Thomas Waldmann 2013-09-28 20:42:18 +02:00
parent faabb97463
commit 44770d9cbd

View File

@ -14,10 +14,8 @@ def MyIpView(request):
def UpdateIpView(request):
ipaddr = request.META['REMOTE_ADDR']
af = dns.inet.af_for_address(ipaddr)
if af == dns.inet.AF_INET:
request.session['ipv4'] = ipaddr
else:
request.session['ipv6'] = ipaddr
key = 'ipv4' if af == dns.inet.AF_INET else 'ipv6'
request.session[key] = ipaddr
return HttpResponse('OK', content_type="text/plain")