Merge lp:~widelands-dev/widelands-website/fix_REMOTE_ADDR into lp:widelands-website
Status: | Merged |
---|---|
Merged at revision: | 427 |
Proposed branch: | lp:~widelands-dev/widelands-website/fix_REMOTE_ADDR |
Merge into: | lp:widelands-website |
Diff against target: |
195 lines (+23/-35) 8 files modified
djangoratings/templatetags/ratings.py (+2/-1) djangoratings/views.py (+3/-2) pybb/views.py (+2/-2) threadedcomments/views.py (+2/-1) wiki/views.py (+2/-10) wl_utils.py (+8/-0) wlimages/views.py (+1/-15) wlmaps/views.py (+3/-4) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands-website/fix_REMOTE_ADDR |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | Approve | ||
Review via email: mp+308337@code.launchpad.net |
Description of the change
Fixes getting the real ip address.
Please take a look into the (unchanged) line of http://
ip_address = request.
It looks like the one parameter is used if the previous doesn't exist. But i couldn't find a documentation of the function get() to use it like this. Because we use the tracking only for showing online users (and not all the other things it can do), it needs also a big cleanup or replaced with another, or own, implementation.
I couldn't test this branch on localhost for HTTP_X_
lgtm. one possible improvement in a comment further down.
> It looks like the one parameter is used if the previous doesn't exist.
That is exactly right. get() is a method on the built in type dict in Python. documentation (for python 2.7) is here: https:/ /docs.python. org/2/library/ stdtypes. html#dict. get
> Because we use the tracking only for showing online users (and not all the other things it can do), it needs also a big cleanup or replaced with another, or own, implementation.
I am not sure what you want to say with this. Why is the current implementation not sufficient?