From bc494f6c18a56f0b9230443ed45183bbdf0a2f40 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 19 May 2012 13:46:06 +0200 Subject: [PATCH] remove ipv6 prefix from ipv4 addresses --- pandora/archive/extract.py | 1 - pandora/user/models.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index dc013b338..e903995e4 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -307,7 +307,6 @@ def resize_image(image_source, image_output, width=None, size=None): def timeline( video, prefix, modes=['antialias', 'slitscan', 'keyframes', 'audio', 'data'], - #modes=['antialias', 'slitscan', 'audio', 'data'], size=[64, 16] ): if isinstance(video, basestring): diff --git a/pandora/user/models.py b/pandora/user/models.py index 1044c5c14..c3acdf8d2 100644 --- a/pandora/user/models.py +++ b/pandora/user/models.py @@ -96,6 +96,8 @@ class SessionData(models.Model): if request.user.is_authenticated(): data.user = request.user data.ip = request.META['REMOTE_ADDR'] + if data.ip.startswith('::ffff:'): + data.ip = data.ip[len('::ffff:'):] data.useragent = request.META['HTTP_USER_AGENT'] data.info = json.loads(request.POST.get('data', '{}')) screen = data.info.get('screen', {})