From 3066b39eb821b38e5cf7bf48063bfd9a6ffb9015 Mon Sep 17 00:00:00 2001 From: Chris Chambers Date: Sun, 19 Sep 2010 18:56:11 +0100 Subject: [PATCH] Stripping port-info from PayPalNVP ipaddress field This is necessary to avoid errors from postgres backends. --- paypal/pro/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paypal/pro/models.py b/paypal/pro/models.py index f430d74..9359887 100644 --- a/paypal/pro/models.py +++ b/paypal/pro/models.py @@ -59,7 +59,7 @@ class Meta: def init(self, request, paypal_request, paypal_response): """Initialize a PayPalNVP instance from a HttpRequest.""" - self.ipaddress = request.META.get('REMOTE_ADDR', '') + self.ipaddress = request.META.get('REMOTE_ADDR', '').split(':')[0] if hasattr(request, "user") and request.user.is_authenticated(): self.user = request.user