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): 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")