handle myip == '' (?myip= in url) - just get ip from REMOTE_ADDR

This commit is contained in:
Thomas Waldmann 2014-04-28 01:08:00 +02:00
parent b818ea9df9
commit 93b54ab479

View File

@ -220,7 +220,7 @@ class NicUpdateView(View):
host.register_client_fault() host.register_client_fault()
return Response('badagent') return Response('badagent')
ipaddr = request.GET.get('myip') ipaddr = request.GET.get('myip')
if ipaddr is None: if not ipaddr: # None or ''
ipaddr = request.META.get('REMOTE_ADDR') ipaddr = request.META.get('REMOTE_ADDR')
ssl = request.is_secure() ssl = request.is_secure()
if delete: if delete: