traviscline (owner)

Revisions

gist: 28674 Download_button fork
public
Public Clone URL: git://gist.github.com/28674.git
Embed All Files: show embed
Diff #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
iff --git a/contrib/comments/views/comments.py b/contrib/comments/views/comments.py
index 3279543..d991f0a 100644
--- a/contrib/comments/views/comments.py
+++ b/contrib/comments/views/comments.py
@@ -87,6 +87,10 @@ def post_comment(request, next=None):
     # Otherwise create the comment
     comment = form.get_comment_object()
     comment.ip_address = request.META.get("REMOTE_ADDR", None)
+
+ if ',' in comment.ip_address:
+ comment.ip_address = comment.ip_address.split(',')[0]
+
     if request.user.is_authenticated():
         comment.user = request.user