Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_ip() fails if any meta field from IPWARE_META_PRECEDENCE_LIST is None #11

Closed
HageMaster3108 opened this issue Nov 23, 2015 · 0 comments

Comments

@HageMaster3108
Copy link

Hi there,

if any of the META keys in IPWARE_META_PRECEDENCE_LIST happens to be undefined/None, get_ip() fails.

Traceback:
File "/Users/patrick/.virtualenvs/ib-cms/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/patrick/.virtualenvs/ib-cms/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)
File "/Users/patrick/Dev/ib-main/cms/views.py" in fallback_upload_view
  192.                 queue.client_ip = get_ip(request)
File "/Users/patrick/.virtualenvs/ib-cms/lib/python2.7/site-packages/ipware/ip.py" in get_ip
  14.         value = request.META.get(key, '').strip()

Will send a pull request...

HageMaster3108 pushed a commit to HageMaster3108/django-ipware that referenced this issue Nov 23, 2015
un33k added a commit that referenced this issue Dec 12, 2015
Fixes issue #11 - No longer throws an exception if any meta key is None
@un33k un33k closed this as completed Dec 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants