From af769c7871a2939f2066ccf6a7c481b81c4f5b91 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 15 Oct 2014 11:58:35 +0100 Subject: [PATCH] allow ip to set via query string for plans page --- .../Features/Subscription/SubscriptionController.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee index ffd1bf475f..de31497fc0 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee @@ -22,7 +22,7 @@ module.exports = SubscriptionController = if req.query.v? viewName = "#{viewName}_#{req.query.v}" logger.log viewName:viewName, "showing plans page" - GeoIpLookup.getCurrencyCode req.ip, (err, recomendedCurrency)-> + GeoIpLookup.getCurrencyCode req.query?.ip || req.ip, (err, recomendedCurrency)-> res.render viewName, title: "plans_and_pricing" plans: plans @@ -41,7 +41,7 @@ module.exports = SubscriptionController = res.redirect "/user/subscription" else currency = req.query.currency?.toUpperCase() - GeoIpLookup.getCurrencyCode req.ip, (err, recomendedCurrency)-> + GeoIpLookup.getCurrencyCode req.query?.ip || req.ip, (err, recomendedCurrency)-> return next(err) if err? if recomendedCurrency? and !currency? currency = recomendedCurrency