Commit 40e29c73 authored by Noe Nieto's avatar Noe Nieto 💬

Rename crowdfound app to cart; Step two

parent 4648a5ae
from django.apps import AppConfig
class CrowdfundingConfig(AppConfig):
name = 'crowdfunding'
class CartConfig(AppConfig):
name = 'cart'
......@@ -2,12 +2,12 @@ from django.test import TestCase
from django.test import override_settings
# @override_settings(ROOT_URLCONF='crowdfunding.tests.urls')
# @override_settings(ROOT_URLCONF='cart.tests.urls')
class RegisterWorkflowTestCase(TestCase):
def test_urls(self):
resp = self.client.get('/crowdfund/1')
resp = self.client.get('/cart/1')
self.assertEqual(resp.status_code, 200)
resp = self.client.get('/crowdfund/2')
resp = self.client.get('/cart/2')
self.assertEqual(resp.status_code, 200)
# User arrives at liberty.one (django)
......
......@@ -2,10 +2,10 @@
URLs used in the unit tests
"""
from django.conf.urls import include, url
from crowdfunding.views import CrowdFundRegistrationView
from cart.views import CartRegistrationView
urlpatterns = [
url(r'^crowdfund/(?P<reward>[0-9])/$', CrowdFundRegistrationView.as_view(), name='crowdfund_pick_reward'),
url(r'^cart/(?P<reward>[0-9])/$', CartRegistrationView.as_view(), name='cart_pick_reward'),
url(r'', include('registration.auth_urls')),
]
\ No newline at end of file
......@@ -3,17 +3,17 @@ from django.conf import settings
from registration.backends.simple.views import RegistrationView
from ldapregister.forms import RegistrationForm
from captcha.fields import CaptchaField
from crowdfunding.models import ChosenReward
from cart.models import ChosenReward
class CrowdFundRegistrationForm(RegistrationForm):
class CartRegistrationForm(RegistrationForm):
captcha = CaptchaField()
class CrowdFundRegistrationView(RegistrationView):
form_class = CrowdFundRegistrationForm
class CartRegistrationView(RegistrationView):
form_class = CartRegistrationForm
# success_url = None
template_name = 'crowdfund/registration_form.html'
template_name = 'cart/registration_form.html'
def post(self, *args, **kwargs):
self.reward = kwargs.get('reward', None)
......@@ -22,7 +22,7 @@ class CrowdFundRegistrationView(RegistrationView):
def get_success_url(self, user):
return '{}/{}/{}'.format(
getattr(settings, 'WOO_URL'),
getattr(settings, 'WOO_CROWDFUND_PATH'),
getattr(settings, 'WOO_CART_PATH'),
str(self.reward)
)
......
......@@ -31,7 +31,7 @@ WOO_WP_API=True
WOO_VERSION=wc/v1
WOO_QUERY_STRING_AUTH = True
WOOSUB1_PRODUCT_LIST = 123,124
WOO_CROWDFUND_PATH=cart
WOO_CART_PATH=cart
OVPN_HOSTNAME=ssh.example.com
OVPN_PORT=22
OVPN_USERNAME=username
......
......@@ -44,7 +44,7 @@ ALLOWED_HOSTS = config("ALLOWED_HOSTS", cast=Csv())
#
INSTALLED_APPS += ["crispy_forms", "django_agpl", "django_celery_beat", "django_extensions", "ldapregister",
"limitmonitor", "purist", "captcha", "crowdfunding", "registration"]
"limitmonitor", "purist", "captcha", "cart", "registration"]
#
# AGPL APPLICATION
......@@ -145,7 +145,7 @@ WOO_URL = config("WOO_URL")
WOO_WP_API = config("WOO_WP_API", cast=bool)
WOO_VERSION = config("WOO_VERSION")
WOO_QUERY_STRING_AUTH = config("WOO_QUERY_STRING_AUTH", cast=bool) # required for OAuth over HTTPS
WOO_CROWDFUND_PATH = config("WOO_CROWDFUND_PATH")
WOO_CART_PATH = config("WOO_CART_PATH")
WOO_CONSUMER_KEY = secret_config("WOO_CONSUMER_KEY")
WOO_CONSUMER_SECRET = secret_config("WOO_CONSUMER_SECRET")
......
......@@ -21,7 +21,7 @@ from registration.backends.simple.views import RegistrationView
import limitmonitor.views
import purist.views
from ldapregister.forms import RegistrationForm
from crowdfunding.views import CrowdFundRegistrationView
from cart.views import CartRegistrationView
#
# Set admin titles for this site
#
......@@ -44,6 +44,6 @@ urlpatterns = [
url(r'^download/', include('django_agpl.urls')),
url(r'^jslicense/$', purist.views.jslicense, name='jslicense'),
url(r'^captcha/', include('captcha.urls')),
url(r'^crowdfund/(?P<reward>\d+)/$', CrowdFundRegistrationView.as_view()),
url(r'^cart/(?P<reward>\d+)/$', CartRegistrationView.as_view()),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment