X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/65c9feda79d2b2c94cb7dcd561318a83fd796f0a..c2e8051452fa55db096553cbe5ae622fc363d481:/src/club/payment_methods.py diff --git a/src/club/payment_methods.py b/src/club/payment_methods.py index ca34ace48..a71a67b9a 100644 --- a/src/club/payment_methods.py +++ b/src/club/payment_methods.py @@ -45,9 +45,13 @@ class PayURe(PaymentMethod): def pay(self, request, schedule): # Create order, put it and see what happens next. from .models import PayUOrder + if request is not None: + ip = request.META['REMOTE_ADDR'] + else: + ip = '127.0.0.1' order = PayUOrder.objects.create( pos_id=self.pos_id, - customer_ip=request.META['REMOTE_ADDR'], + customer_ip=ip, schedule=schedule, ) return order.put()