From 079513da1794f515d763c8ddedaebc37db054e7a Mon Sep 17 00:00:00 2001 From: Andy McKay Date: Wed, 26 Oct 2011 11:16:38 -0700 Subject: [PATCH] user addon_url to allow apps path or addons path and avoid any slug issues (bug 694428) --- .../templates/addons/impala/button.html | 4 +- .../addons/templates/addons/paypal_start.html | 4 +- apps/addons/tests/test_views.py | 83 ++++++++++++++++++- apps/addons/urls.py | 2 + apps/addons/views.py | 16 ++++ apps/users/tests/test_views.py | 79 +----------------- apps/users/urls.py | 2 - apps/users/views.py | 15 ---- apps/webapps/urls.py | 9 ++ 9 files changed, 113 insertions(+), 101 deletions(-) diff --git a/apps/addons/templates/addons/impala/button.html b/apps/addons/templates/addons/impala/button.html index 7dd49893c1..93c1285672 100644 --- a/apps/addons/templates/addons/impala/button.html +++ b/apps/addons/templates/addons/impala/button.html @@ -10,8 +10,8 @@ data-name="{{ addon.name }}" {{ b.attrs()|xmlattr }} {% if waffle.switch('marketplace') and addon.can_be_purchased() %} - data-purchase="{{ url('addons.purchase', addon.slug) }}?" - data-start-purchase="{{ url('users.purchase.start', addon.slug) }}" + data-purchase="{{ addon_url('addons.purchase', addon) }}?" + data-start-purchase="{{ addon_url('addons.purchase.start', addon) }}" data-cost="{{ addon.premium.get_price() }}" data-login-url="{{ url('users.login_modal') }}" {% endif %} diff --git a/apps/addons/templates/addons/paypal_start.html b/apps/addons/templates/addons/paypal_start.html index df0f9e4e37..c8e6007796 100644 --- a/apps/addons/templates/addons/paypal_start.html +++ b/apps/addons/templates/addons/paypal_start.html @@ -40,7 +40,7 @@ {% endtrans %}