Commit 5d8a3c2d authored by Noe Nieto's avatar Noe Nieto 💬

Add woocommerce base path for redirection after user creation, create...

Add woocommerce base path for redirection after user creation, create migration for crowdfunding app. Also CC liberty/internal#111
parent 2bfa3e8a
......@@ -31,6 +31,7 @@ WOO_WP_API=True
WOO_VERSION=wc/v1
WOO_QUERY_STRING_AUTH = True
WOOSUB1_PRODUCT_LIST = 123,124
WOO_CROWDFUND_PATH=cart
OVPN_HOSTNAME=ssh.example.com
OVPN_PORT=22
OVPN_USERNAME=username
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-22 07:29
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='ChosenReward',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('reward', models.IntegerField()),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
......@@ -6,12 +6,13 @@ from captcha.fields import CaptchaField
from crowdfunding.models import ChosenReward
class CroudFundRegistrationForm(RegistrationForm):
captcha = CaptchaField()
class CrowdFundRegistrationForm(RegistrationForm):
# captcha = CaptchaField()
pass
class CrowdFundRegistrationView(RegistrationView):
form_class = CroudFundRegistrationForm
form_class = CrowdFundRegistrationForm
# success_url = None
template_name = 'crowdfund/registration_form.html'
......@@ -20,8 +21,9 @@ class CrowdFundRegistrationView(RegistrationView):
return super().post(*args, **kwargs)
def get_success_url(self, user):
return '{}/{}'.format(
return '{}/{}/{}'.format(
getattr(settings, 'WOO_URL'),
getattr(settings, 'WOO_CROWDFUND_PATH'),
str(self.reward)
)
......
......@@ -145,6 +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_CONSUMER_KEY = secret_config("WOO_CONSUMER_KEY")
WOO_CONSUMER_SECRET = secret_config("WOO_CONSUMER_SECRET")
......
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