diff --git a/rowers/braintreestuff.py b/rowers/braintreestuff.py
index fda05793..f03bc2e1 100644
--- a/rowers/braintreestuff.py
+++ b/rowers/braintreestuff.py
@@ -217,17 +217,22 @@ def create_subscription(rower,data):
"payment_method_nonce": nonce_from_the_client
})
+ print 'aap'
+
if result.is_success:
payment_method_token = result.payment_method.token
else:
return False,0
+ print 'noot'
+
result = gateway.subscription.create({
"payment_method_token": payment_method_token,
"plan_id": plan.external_id
})
if result.is_success:
+ print 'mies'
rower.paidplan = plan
rower.planexpires = result.subscription.billing_period_end_date
rower.teamplanexpires = result.subscription.billing_period_end_date
diff --git a/rowers/templates/instroke.html b/rowers/templates/instroke.html
index 531962e9..9e8c6bcd 100644
--- a/rowers/templates/instroke.html
+++ b/rowers/templates/instroke.html
@@ -12,7 +12,7 @@
This is a preview of the page with advanced functionality for Pro users.
- See the About page for more information
+ See the About page for more information
and to sign up for Pro Membership
{% endif %}
@@ -30,7 +30,7 @@
Public link to this workout
- https://rowsandall.com/rowers/workout/{{ workout.id }}
+ https://rowsandall.com/rowers/workout/{{ workout.id }}
@@ -42,7 +42,7 @@
{% if instrokemetrics %}
{% for metric in instrokemetrics %}
- {{ metric }}
+ {{ metric }}
{% endfor %}
{% else %}
diff --git a/rowers/templates/otwinteractive.html b/rowers/templates/otwinteractive.html
index 33898af5..099cdaf4 100644
--- a/rowers/templates/otwinteractive.html
+++ b/rowers/templates/otwinteractive.html
@@ -35,7 +35,7 @@
While the wind and stream correction is fairly reliable, the OTW to OTE conversion sometimes throws errors. Those data points are omitted and replaced by interpolated values. We are sorry if this messed up some of your plots.
- Read more details about the way we calculate things here .
+ Read more details about the way we calculate things here .
diff --git a/rowers/tests/mocks.py b/rowers/tests/mocks.py
index ed8022f7..5a7c8ba7 100644
--- a/rowers/tests/mocks.py
+++ b/rowers/tests/mocks.py
@@ -172,7 +172,127 @@ class MockStravalibClient():
def update_activity(*args, **kwargs):
return StravaActivity()
+class gatewayresult():
+ def __init__(self,*args,**kwargs):
+ self.is_success = kwargs.pop('is_success',True)
+ self.customer_id = 1
+ self.transaction = vtransaction()
+ self.payment_method = payment_method()
+ self.subscription = vsubscription()
+class credit_card():
+ def __init__(self, *args, **kwargs):
+ self.subscriptions = [vsubscription()]
+ self.country_of_issuance = 'US'
+
+class paypal_account():
+ def __init__(self, *args, **kwargs):
+ self.subscriptions = [vsubscription(),vsubscription()]
+
+class customer():
+ def find(*arg, **kwargs):
+ return self
+
+ def create(*args, **kwargs):
+ return gatewayresult(is_success=True)
+
+ def __init__(self, *args, **kwargs):
+ self.credit_cards = [credit_card(),credit_card()]
+ self.paypal_accounts = [paypal_account()]
+
+class client_token():
+ def generate(*args, **kwargs):
+ return 'aapnooit'
+
+class plan():
+ def all(*args, **kwargs):
+ return []
+
+
+
+class transaction():
+ def sale(*args, **kwargs):
+ return gatewayresult(is_success=True)
+
+ def search(*args, **kwargs):
+ return [gatewayresult(is_success=True),gatewayresult(is_success=True)]
+
+ def __init__(self,*args, **kwargs):
+ self.amount = 15
+ self.credit_card_details = credit_card()
+ self.customer = {
+ 'first_name': 'John',
+ 'last_name': 'Doe',
+ 'id': 12
+ }
+ self.created_at = datetime.datetime.now()
+ self.currency_iso_code = 'EUR'
+
+class vtransaction():
+ def __init__(self,*args, **kwargs):
+ self.amount = 15
+ self.credit_card_details = credit_card()
+ self.customer = {
+ 'first_name': 'John',
+ 'last_name': 'Doe',
+ 'id': 12
+ }
+ self.created_at = datetime.datetime.now()
+ self.currency_iso_code = 'EUR'
+
+class vsubscription():
+ def update(*args, **kwargs):
+ return gatewayresult(is_success=True)
+
+ def cancel(*args, **kwargs):
+ return gatewayresult()
+
+ def __init__(self, *args, **kwargs):
+ self.id = 121
+ self.billing_period_end_date = (datetime.datetime.now()+datetime.timedelta(days=365)).date()
+ self.status = 'Active'
+ self.plan_id = 12
+ self.price = 15
+ self.never_expires = True
+
+class subscription():
+ def create(*args, **kwargs):
+ return gatewayresult(is_success=True)
+
+ def update(*args, **kwargs):
+ return gatewayresult(is_success=True)
+
+ def cancel(*args, **kwargs):
+ return gatewayresult()
+
+ def __init__(self, *args, **kwargs):
+ self.id = 121
+ self.billing_period_end_date = (datetime.datetime.now()+datetime.timedelta(days=365)).date()
+ self.transactions = [vtransaction()]
+ self.status = 'Active'
+ self.plan_id = 12
+ self.price = 15
+ self.never_expires = True
+
+
+class payment_method():
+ def create(*args, **kwargs):
+ return gatewayresult()
+
+ def __init__(self, *args, **kwargs):
+ self.token = 'liesjeleerdelotje'
+
+# mock braintree gateway
+class MockBraintreeGateway():
+ def __init__(self,*args, **kwargs):
+ self.customer = customer()
+ self.client_token = client_token()
+ self.plan = plan()
+ self.transaction = transaction()
+ self.subscription = subscription()
+ self.payment_method = payment_method()
+
+
class mocked_rowingdata(rowingdata):
def __init__(self, *args, **kwargs):
super(mocked_rowingdata).__init__(*args, **kwargs)
diff --git a/rowers/tests/test_errorpages.py b/rowers/tests/test_errorpages.py
index 57ea66b0..cd9c23a0 100644
--- a/rowers/tests/test_errorpages.py
+++ b/rowers/tests/test_errorpages.py
@@ -17,3 +17,6 @@ class TestErrorPages(TestCase):
self.assertEqual(response.status_code, 500)
self.assertIn('500 Internal Server Error', unicode(response))
+ response = error400_view(request)
+ self.assertEqual(response.status_code, 400)
+
diff --git a/rowers/tests/test_payments.py b/rowers/tests/test_payments.py
new file mode 100644
index 00000000..c6341649
--- /dev/null
+++ b/rowers/tests/test_payments.py
@@ -0,0 +1,270 @@
+from statements import *
+
+nu = datetime.datetime.now()
+
+from django_countries import countries
+
+class PaymentTest(TestCase):
+ def setUp(self):
+ self.u = UserFactory()
+ self.r = Rower.objects.create(user=self.u,
+ birthdate=faker.profile()['birthdate'],
+ gdproptin=True,
+ gdproptindate=timezone.now(),
+ rowerplan='coach',
+ paymentprocessor='braintree',
+ street_address = faker.street_address(),
+ city = faker.city(),
+ postal_code = faker.postalcode(),
+ country = faker.country(),
+ )
+
+ p = PaidPlan(
+ shortname='free',
+ name='Basic',
+ external_id='a',
+ price=0,
+ paymentprocessor='braintree',
+ paymenttype='single',
+ )
+
+ p.save()
+
+ p = PaidPlan(
+ shortname='pro_recurring',
+ name='Pro (recurring)',
+ external_id='b',
+ price=15,
+ paymentprocessor='braintree',
+ paymenttype='single',
+ )
+
+ p.save()
+
+ p = PaidPlan(
+ shortname='pro_single',
+ name='Pro (single)',
+ external_id='c',
+ price=20,
+ paymentprocessor='braintree',
+ paymenttype='single',
+ )
+
+ p.save()
+
+ self.c = Client()
+ self.password = faker.word()
+ self.u.set_password(self.password)
+ self.u.save()
+
+ @patch('rowers.braintreestuff.braintree.BraintreeGateway',side_effect=MockBraintreeGateway)
+ def test_billing_view(self,mock_gateway):
+ login = self.c.login(username=self.u.username, password=self.password)
+ self.assertTrue(login)
+
+ url = '/rowers/billing/'
+
+ response = self.c.get(url)
+ self.assertEqual(response.status_code,200)
+
+ plans = PaidPlan.objects.filter(price__gt=0).order_by('price')
+ plan = plans[0]
+
+ country = faker.country()
+ countrycode = 'NL'
+ for code, name in list(countries):
+ if name.lower() == country.lower():
+ countrycode = code
+
+ form_data = {
+ 'street_address':faker.street_address(),
+ 'city':faker.city(),
+ 'postal_code':faker.postalcode(),
+ 'country':countrycode,
+ 'plan':plan.id,
+ }
+
+ form = RowerBillingAddressForm(form_data)
+ self.assertTrue(form.is_valid)
+
+ form = PlanSelectForm(form_data,paymentprocessor='braintree')
+ self.assertTrue(form.is_valid)
+
+ response = self.c.post(url,form_data,follow=True)
+ self.assertEqual(response.status_code,200)
+
+ expected_url = '/rowers/checkout/'+str(plan.id)+'/'
+
+ self.assertRedirects(response,
+ expected_url = expected_url,
+ status_code=302,target_status_code=200)
+
+ @patch('rowers.braintreestuff.braintree.BraintreeGateway',side_effect=MockBraintreeGateway)
+ def test_upgrade_view(self,mock_gateway):
+ self.r.country = 'NL'
+ self.r.customer_id = 34
+ self.r.subscription_id = 34
+ self.r.save()
+
+ login = self.c.login(username=self.u.username, password=self.password)
+ self.assertTrue(login)
+
+ url = '/rowers/upgrade/'
+
+ response = self.c.get(url)
+ self.assertEqual(response.status_code,200)
+
+ plans = PaidPlan.objects.filter(price__gt=0).order_by('price')
+ plan = plans[0]
+
+ country = faker.country()
+ countrycode = 'NL'
+ for code, name in list(countries):
+ if name.lower() == country.lower():
+ countrycode = code
+
+ form_data = {
+ 'street_address':faker.street_address(),
+ 'city':faker.city(),
+ 'postal_code':faker.postalcode(),
+ 'country':countrycode,
+ 'plan':plan.id,
+ }
+
+ form = RowerBillingAddressForm(form_data)
+ self.assertTrue(form.is_valid)
+
+ form = PlanSelectForm(form_data,paymentprocessor='braintree')
+ self.assertTrue(form.is_valid)
+
+ response = self.c.post(url,form_data,follow=True)
+ self.assertEqual(response.status_code,200)
+
+ expected_url = '/rowers/upgradecheckout/'+str(plan.id)+'/'
+
+ self.assertRedirects(response,
+ expected_url = expected_url,
+ status_code=302,target_status_code=200)
+
+ @patch('rowers.braintreestuff.braintree.BraintreeGateway',side_effect=MockBraintreeGateway)
+ def test_down_view(self,mock_gateway):
+ self.r.country = 'NL'
+ self.r.customer_id = 34
+ self.r.subscription_id = 34
+ self.r.save()
+
+ plans = PaidPlan.objects.all().order_by('price')
+ plan = plans[1]
+
+ self.r.paidplan = plan
+ self.r.save()
+
+ login = self.c.login(username=self.u.username, password=self.password)
+ self.assertTrue(login)
+
+ url = '/rowers/downgrade/'
+
+ response = self.c.get(url)
+ self.assertEqual(response.status_code,200)
+
+ country = faker.country()
+ countrycode = 'NL'
+ for code, name in list(countries):
+ if name.lower() == country.lower():
+ countrycode = code
+
+ form_data = {
+ 'street_address':faker.street_address(),
+ 'city':faker.city(),
+ 'postal_code':faker.postalcode(),
+ 'country':countrycode,
+ 'plan':plans[0].id,
+ }
+
+ form = RowerBillingAddressForm(form_data)
+ self.assertTrue(form.is_valid)
+
+ form = PlanSelectForm(form_data,paymentprocessor='braintree')
+ self.assertTrue(form.is_valid)
+
+ response = self.c.post(url,form_data,follow=True)
+ self.assertEqual(response.status_code,200)
+
+ expected_url = '/rowers/downgradecheckout/'+str(plans[0].id)+'/'
+
+ self.assertRedirects(response,
+ expected_url = expected_url,
+ status_code=302,target_status_code=200)
+
+ @patch('rowers.braintreestuff.braintree.BraintreeGateway',side_effect=MockBraintreeGateway)
+ def test_planstop_view(self,mock_gateway):
+ self.r.country = 'NL'
+ self.r.customer_id = 34
+ self.r.subscription_id = 34
+ self.r.save()
+
+ plans = PaidPlan.objects.all().order_by('price')
+ plan = plans[1]
+
+ self.r.paidplan = plan
+ self.r.save()
+
+ login = self.c.login(username=self.u.username, password=self.password)
+ self.assertTrue(login)
+
+ url = '/rowers/me/cancelsubscriptions/'
+
+ response = self.c.get(url)
+ self.assertEqual(response.status_code,200)
+
+
+ @patch('rowers.braintreestuff.braintree.BraintreeGateway',side_effect=MockBraintreeGateway)
+ def test_planstobasic_view(self,mock_gateway):
+ self.r.country = 'NL'
+ self.r.customer_id = 34
+ self.r.subscription_id = 34
+ self.r.save()
+
+ plans = PaidPlan.objects.all().order_by('price')
+ plan = plans[1]
+
+ self.r.paidplan = plan
+ self.r.save()
+
+ login = self.c.login(username=self.u.username, password=self.password)
+ self.assertTrue(login)
+
+ url = '/rowers/me/cancelsubscription/34/'
+
+ response = self.c.get(url,follow=True)
+ self.assertEqual(response.status_code,200)
+ self.assertRedirects(response,
+ expected_url = '/rowers/me/cancelsubscriptions/',
+ status_code=302,target_status_code=200)
+
+ @patch('rowers.braintreestuff.braintree.BraintreeGateway',side_effect=MockBraintreeGateway)
+ def test_checkouts_view(self,mock_gateway):
+
+ plans = PaidPlan.objects.all().order_by('price')
+ plan = plans[1]
+
+ form_data = {
+ 'amount':'15.00',
+ 'plan': plans[1].id,
+ 'payment_method_nonce': 'aap',
+ }
+
+ form = BillingForm(form_data)
+ self.assertTrue(form.is_valid)
+
+ login = self.c.login(username=self.u.username, password=self.password)
+ self.assertTrue(login)
+
+ url = '/rowers/checkouts/'
+
+ response = self.c.post(url, form_data,follow=True)
+ self.assertEqual(response.status_code,200)
+
+ self.assertRedirects(response,
+ expected_url = '/rowers/paymentcompleted/',
+ status_code=302,target_status_code=200)
diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz
index b3b0bd05..1473a31a 100644
Binary files a/rowers/tests/testdata/testdata.csv.gz and b/rowers/tests/testdata/testdata.csv.gz differ
diff --git a/rowers/tests/testdata/testdata.tcx b/rowers/tests/testdata/testdata.tcx
deleted file mode 100644
index 1d994ccf..00000000
--- a/rowers/tests/testdata/testdata.tcx
+++ /dev/null
@@ -1,2523 +0,0 @@
-
-
-
-
- 2016-05-20T13:41:26.962390+00:00
-
- 537
- 2000
- 1
-
- 148
-
-
- 156
-
- Active
- 21
- Manual
-
-
- 2016-05-20T13:41:26+00:00
- 5.4
-
- 127
-
- 0
-
-
- 19
-
-
-
-
- 2016-05-20T13:41:29.238150+00:00
- 13.1
-
- 127
-
- 19
-
-
- 26
-
-
-
-
- 2016-05-20T13:41:32.148290+00:00
- 21.0
-
- 128
-
- 20
-
-
- 45
-
-
-
-
- 2016-05-20T13:41:35.269000+00:00
- 30.3
-
- 129
-
- 20
-
-
- 64
-
-
-
-
- 2016-05-20T13:41:38.152180+00:00
- 39.0
-
- 130
-
- 20
-
-
- 74
-
-
-
-
- 2016-05-20T13:41:41.148270+00:00
- 48.2
-
- 131
-
- 21
-
-
- 80
-
-
-
-
- 2016-05-20T13:41:44.148910+00:00
- 57.6
-
- 131
-
- 20
-
-
- 83
-
-
-
-
- 2016-05-20T13:41:46.908250+00:00
- 66.4
-
- 132
-
- 20
-
-
- 87
-
-
-
-
- 2016-05-20T13:41:49.819010+00:00
- 75.5
-
- 132
-
- 21
-
-
- 86
-
-
-
-
- 2016-05-20T13:41:52.942510+00:00
- 85.1
-
- 132
-
- 20
-
-
- 88
-
-
-
-
- 2016-05-20T13:41:55.639670+00:00
- 95.0
-
- 132
-
- 21
-
-
- 100
-
-
-
-
- 2016-05-20T13:41:58.370000+00:00
- 105.0
-
- 133
-
- 22
-
-
- 127
-
-
-
-
- 2016-05-20T13:42:01.188270+00:00
- 115.3
-
- 134
-
- 21
-
-
- 135
-
-
-
-
- 2016-05-20T13:42:04.008300+00:00
- 125.8
-
- 135
-
- 21
-
-
- 139
-
-
-
-
- 2016-05-20T13:42:06.888990+00:00
- 136.6
-
- 136
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:42:09.678900+00:00
- 147.2
-
- 137
-
- 22
-
-
- 150
-
-
-
-
- 2016-05-20T13:42:12.469140+00:00
- 157.6
-
- 139
-
- 22
-
-
- 152
-
-
-
-
- 2016-05-20T13:42:15.199010+00:00
- 167.8
-
- 140
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:42:17.963080+00:00
- 178.5
-
- 140
-
- 22
-
-
- 150
-
-
-
-
- 2016-05-20T13:42:20.658340+00:00
- 188.5
-
- 141
-
- 21
-
-
- 155
-
-
-
-
- 2016-05-20T13:42:23.538800+00:00
- 199.3
-
- 141
-
- 21
-
-
- 148
-
-
-
-
- 2016-05-20T13:42:26.269790+00:00
- 209.4
-
- 142
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:42:28.848350+00:00
- 219.4
-
- 142
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:42:31.729550+00:00
- 230.2
-
- 143
-
- 22
-
-
- 148
-
-
-
-
- 2016-05-20T13:42:34.398400+00:00
- 240.2
-
- 144
-
- 22
-
-
- 147
-
-
-
-
- 2016-05-20T13:42:37.038360+00:00
- 250.1
-
- 145
-
- 23
-
-
- 150
-
-
-
-
- 2016-05-20T13:42:39.499250+00:00
- 259.6
-
- 145
-
- 23
-
-
- 152
-
-
-
-
- 2016-05-20T13:42:42.349070+00:00
- 270.3
-
- 145
-
- 23
-
-
- 152
-
-
-
-
- 2016-05-20T13:42:45.079070+00:00
- 280.6
-
- 145
-
- 22
-
-
- 149
-
-
-
-
- 2016-05-20T13:42:47.752890+00:00
- 290.7
-
- 144
-
- 22
-
-
- 150
-
-
-
-
- 2016-05-20T13:42:50.452350+00:00
- 300.8
-
- 145
-
- 23
-
-
- 149
-
-
-
-
- 2016-05-20T13:42:53.182630+00:00
- 311.1
-
- 145
-
- 22
-
-
- 152
-
-
-
-
- 2016-05-20T13:42:55.789410+00:00
- 321.2
-
- 145
-
- 22
-
-
- 157
-
-
-
-
- 2016-05-20T13:42:58.671890+00:00
- 331.9
-
- 145
-
- 21
-
-
- 150
-
-
-
-
- 2016-05-20T13:43:01.338860+00:00
- 342.0
-
- 146
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:43:04.068490+00:00
- 352.4
-
- 146
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:43:06.862620+00:00
- 363.0
-
- 146
-
- 22
-
-
- 153
-
-
-
-
- 2016-05-20T13:43:09.618500+00:00
- 373.4
-
- 147
-
- 22
-
-
- 152
-
-
-
-
- 2016-05-20T13:43:12.379160+00:00
- 383.9
-
- 147
-
- 22
-
-
- 153
-
-
-
-
- 2016-05-20T13:43:15.229200+00:00
- 394.6
-
- 147
-
- 22
-
-
- 152
-
-
-
-
- 2016-05-20T13:43:17.963150+00:00
- 405.0
-
- 147
-
- 21
-
-
- 149
-
-
-
-
- 2016-05-20T13:43:20.692490+00:00
- 415.3
-
- 148
-
- 22
-
-
- 152
-
-
-
-
- 2016-05-20T13:43:23.628520+00:00
- 426.0
-
- 148
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:43:26.329210+00:00
- 436.5
-
- 148
-
- 21
-
-
- 149
-
-
-
-
- 2016-05-20T13:43:29.148960+00:00
- 446.9
-
- 148
-
- 22
-
-
- 149
-
-
-
-
- 2016-05-20T13:43:31.668570+00:00
- 456.9
-
- 149
-
- 22
-
-
- 156
-
-
-
-
- 2016-05-20T13:43:34.490920+00:00
- 467.6
-
- 149
-
- 22
-
-
- 155
-
-
-
-
- 2016-05-20T13:43:37.369250+00:00
- 478.5
-
- 150
-
- 22
-
-
- 156
-
-
-
-
- 2016-05-20T13:43:40.189230+00:00
- 489.0
-
- 150
-
- 21
-
-
- 154
-
-
-
-
- 2016-05-20T13:43:42.798860+00:00
- 499.1
-
- 150
-
- 21
-
-
- 148
-
-
-
-
- 2016-05-20T13:43:45.708750+00:00
- 510.0
-
- 150
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:43:48.318590+00:00
- 519.9
-
- 149
-
- 22
-
-
- 153
-
-
-
-
- 2016-05-20T13:43:51.199500+00:00
- 530.6
-
- 149
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:43:53.869290+00:00
- 540.8
-
- 149
-
- 22
-
-
- 148
-
-
-
-
- 2016-05-20T13:43:56.572490+00:00
- 550.8
-
- 148
-
- 22
-
-
- 149
-
-
-
-
- 2016-05-20T13:43:59.212410+00:00
- 560.8
-
- 148
-
- 22
-
-
- 144
-
-
-
-
- 2016-05-20T13:44:01.912890+00:00
- 571.0
-
- 147
-
- 22
-
-
- 149
-
-
-
-
- 2016-05-20T13:44:04.459350+00:00
- 580.7
-
- 147
-
- 22
-
-
- 150
-
-
-
-
- 2016-05-20T13:44:07.249360+00:00
- 591.2
-
- 147
-
- 22
-
-
- 151
-
-
-
-
- 2016-05-20T13:44:09.949930+00:00
- 601.4
-
- 147
-
- 22
-
-
- 150
-
-
-
-
- 2016-05-20T13:44:12.619870+00:00
- 611.4
-
- 147
-
- 23
-
-
- 153
-
-
-
-
- 2016-05-20T13:44:15.378800+00:00
- 621.8
-
- 147
-
- 23
-
-
- 151
-
-
-
-
- 2016-05-20T13:44:18.049420+00:00
- 632.1
-
- 147
-
- 22
-
-
- 155
-
-
-
-
- 2016-05-20T13:44:20.719440+00:00
- 642.3
-
- 147
-
- 22
-
-
- 154
-
-
-
-
- 2016-05-20T13:44:23.298970+00:00
- 652.0
-
- 148
-
- 23
-
-
- 157
-
-
-
-
- 2016-05-20T13:44:26.178820+00:00
- 662.7
-
- 148
-
- 23
-
-
- 162
-
-
-
-
- 2016-05-20T13:44:28.669980+00:00
- 673.1
-
- 148
-
- 23
-
-
- 163
-
-
-
-
- 2016-05-20T13:44:31.429270+00:00
- 683.6
-
- 149
-
- 22
-
-
- 163
-
-
-
-
- 2016-05-20T13:44:34.042790+00:00
- 693.8
-
- 149
-
- 22
-
-
- 162
-
-
-
-
- 2016-05-20T13:44:36.589070+00:00
- 703.8
-
- 149
-
- 22
-
-
- 164
-
-
-
-
- 2016-05-20T13:44:39.412800+00:00
- 714.7
-
- 150
-
- 23
-
-
- 162
-
-
-
-
- 2016-05-20T13:44:42.078870+00:00
- 724.9
-
- 150
-
- 22
-
-
- 162
-
-
-
-
- 2016-05-20T13:44:44.783760+00:00
- 735.2
-
- 151
-
- 23
-
-
- 159
-
-
-
-
- 2016-05-20T13:44:47.450710+00:00
- 745.4
-
- 151
-
- 22
-
-
- 158
-
-
-
-
- 2016-05-20T13:44:50.149400+00:00
- 756.0
-
- 151
-
- 23
-
-
- 164
-
-
-
-
- 2016-05-20T13:44:52.789720+00:00
- 766.3
-
- 150
-
- 22
-
-
- 163
-
-
-
-
- 2016-05-20T13:44:55.429750+00:00
- 776.5
-
- 150
-
- 22
-
-
- 161
-
-
-
-
- 2016-05-20T13:44:58.069700+00:00
- 786.9
-
- 150
-
- 23
-
-
- 163
-
-
-
-
- 2016-05-20T13:45:00.742790+00:00
- 797.2
-
- 150
-
- 22
-
-
- 165
-
-
-
-
- 2016-05-20T13:45:03.442700+00:00
- 807.8
-
- 150
-
- 23
-
-
- 166
-
-
-
-
- 2016-05-20T13:45:06.139610+00:00
- 818.2
-
- 150
-
- 23
-
-
- 166
-
-
-
-
- 2016-05-20T13:45:08.689490+00:00
- 828.4
-
- 150
-
- 22
-
-
- 168
-
-
-
-
- 2016-05-20T13:45:11.479530+00:00
- 839.2
-
- 150
-
- 23
-
-
- 169
-
-
-
-
- 2016-05-20T13:45:14.119610+00:00
- 849.6
-
- 151
-
- 23
-
-
- 166
-
-
-
-
- 2016-05-20T13:45:16.792860+00:00
- 860.1
-
- 151
-
- 22
-
-
- 172
-
-
-
-
- 2016-05-20T13:45:19.368950+00:00
- 870.3
-
- 152
-
- 22
-
-
- 172
-
-
-
-
- 2016-05-20T13:45:22.158960+00:00
- 881.1
-
- 152
-
- 22
-
-
- 169
-
-
-
-
- 2016-05-20T13:45:24.889580+00:00
- 891.7
-
- 152
-
- 23
-
-
- 167
-
-
-
-
- 2016-05-20T13:45:27.558940+00:00
- 902.1
-
- 152
-
- 22
-
-
- 164
-
-
-
-
- 2016-05-20T13:45:30.469760+00:00
- 913.1
-
- 152
-
- 22
-
-
- 161
-
-
-
-
- 2016-05-20T13:45:33.259860+00:00
- 923.9
-
- 153
-
- 22
-
-
- 158
-
-
-
-
- 2016-05-20T13:45:36.079590+00:00
- 934.6
-
- 154
-
- 21
-
-
- 158
-
-
-
-
- 2016-05-20T13:45:38.899560+00:00
- 945.4
-
- 154
-
- 21
-
-
- 154
-
-
-
-
- 2016-05-20T13:45:41.689980+00:00
- 956.0
-
- 155
-
- 21
-
-
- 155
-
-
-
-
- 2016-05-20T13:45:44.568940+00:00
- 966.7
-
- 155
-
- 21
-
-
- 152
-
-
-
-
- 2016-05-20T13:45:47.329670+00:00
- 977.4
-
- 156
-
- 21
-
-
- 150
-
-
-
-
- 2016-05-20T13:45:50.149560+00:00
- 988.1
-
- 156
-
- 21
-
-
- 157
-
-
-
-
- 2016-05-20T13:45:52.969660+00:00
- 998.8
-
- 156
-
- 21
-
-
- 155
-
-
-
-
- 2016-05-20T13:45:55.879910+00:00
- 1009.6
-
- 156
-
- 21
-
-
- 151
-
-
-
-
- 2016-05-20T13:45:58.789690+00:00
- 1020.6
-
- 156
-
- 21
-
-
- 147
-
-
-
-
- 2016-05-20T13:46:01.729660+00:00
- 1031.5
-
- 156
-
- 20
-
-
- 145
-
-
-
-
- 2016-05-20T13:46:04.669610+00:00
- 1042.5
-
- 156
-
- 21
-
-
- 144
-
-
-
-
- 2016-05-20T13:46:07.549730+00:00
- 1053.3
-
- 155
-
- 20
-
-
- 145
-
-
-
-
- 2016-05-20T13:46:10.458930+00:00
- 1064.1
-
- 155
-
- 21
-
-
- 147
-
-
-
-
- 2016-05-20T13:46:13.488980+00:00
- 1075.3
-
- 155
-
- 20
-
-
- 142
-
-
-
-
- 2016-05-20T13:46:16.429320+00:00
- 1086.1
-
- 155
-
- 20
-
-
- 136
-
-
-
-
- 2016-05-20T13:46:19.519650+00:00
- 1097.5
-
- 155
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:46:22.459630+00:00
- 1108.5
-
- 155
-
- 20
-
-
- 146
-
-
-
-
- 2016-05-20T13:46:25.338880+00:00
- 1119.2
-
- 155
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:46:28.459530+00:00
- 1130.6
-
- 155
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:46:31.401590+00:00
- 1141.3
-
- 155
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:46:34.339560+00:00
- 1152.4
-
- 155
-
- 21
-
-
- 142
-
-
-
-
- 2016-05-20T13:46:37.309450+00:00
- 1163.3
-
- 155
-
- 20
-
-
- 138
-
-
-
-
- 2016-05-20T13:46:40.098920+00:00
- 1173.8
-
- 154
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:46:43.039950+00:00
- 1184.8
-
- 154
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:46:46.039490+00:00
- 1195.8
-
- 153
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:46:48.979630+00:00
- 1206.6
-
- 152
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:46:51.949590+00:00
- 1217.3
-
- 153
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:46:54.709590+00:00
- 1227.8
-
- 152
-
- 21
-
-
- 140
-
-
-
-
- 2016-05-20T13:46:57.589710+00:00
- 1238.7
-
- 152
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:47:00.503120+00:00
- 1249.5
-
- 151
-
- 21
-
-
- 149
-
-
-
-
- 2016-05-20T13:47:03.408950+00:00
- 1260.1
-
- 151
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:47:06.323410+00:00
- 1270.9
-
- 151
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:47:09.229670+00:00
- 1281.8
-
- 150
-
- 21
-
-
- 145
-
-
-
-
- 2016-05-20T13:47:12.198960+00:00
- 1292.7
-
- 151
-
- 20
-
-
- 142
-
-
-
-
- 2016-05-20T13:47:15.079930+00:00
- 1303.4
-
- 151
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:47:17.989660+00:00
- 1314.3
-
- 151
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:47:20.959680+00:00
- 1325.2
-
- 151
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:47:23.869730+00:00
- 1336.1
-
- 152
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:47:26.782970+00:00
- 1346.9
-
- 152
-
- 21
-
-
- 144
-
-
-
-
- 2016-05-20T13:47:29.688910+00:00
- 1357.4
-
- 152
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:47:32.539570+00:00
- 1368.1
-
- 152
-
- 21
-
-
- 138
-
-
-
-
- 2016-05-20T13:47:35.449720+00:00
- 1379.0
-
- 152
-
- 20
-
-
- 142
-
-
-
-
- 2016-05-20T13:47:38.329080+00:00
- 1389.5
-
- 153
-
- 21
-
-
- 145
-
-
-
-
- 2016-05-20T13:47:41.148960+00:00
- 1399.9
-
- 152
-
- 21
-
-
- 138
-
-
-
-
- 2016-05-20T13:47:44.088880+00:00
- 1410.7
-
- 152
-
- 20
-
-
- 139
-
-
-
-
- 2016-05-20T13:47:47.150600+00:00
- 1422.0
-
- 152
-
- 20
-
-
- 139
-
-
-
-
- 2016-05-20T13:47:50.029750+00:00
- 1432.8
-
- 151
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:47:52.998850+00:00
- 1443.6
-
- 151
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:47:55.880360+00:00
- 1454.4
-
- 152
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:47:58.789400+00:00
- 1465.1
-
- 151
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:01.639760+00:00
- 1475.9
-
- 152
-
- 21
-
-
- 145
-
-
-
-
- 2016-05-20T13:48:04.492770+00:00
- 1486.6
-
- 152
-
- 21
-
-
- 148
-
-
-
-
- 2016-05-20T13:48:07.429530+00:00
- 1497.4
-
- 153
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:10.373270+00:00
- 1508.2
-
- 153
-
- 20
-
-
- 140
-
-
-
-
- 2016-05-20T13:48:13.309500+00:00
- 1519.2
-
- 154
-
- 20
-
-
- 144
-
-
-
-
- 2016-05-20T13:48:16.279570+00:00
- 1530.0
-
- 154
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:19.160740+00:00
- 1540.9
-
- 153
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:48:21.948820+00:00
- 1551.3
-
- 153
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:25.039520+00:00
- 1562.6
-
- 153
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:48:27.949340+00:00
- 1573.3
-
- 153
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:48:30.890880+00:00
- 1584.2
-
- 152
-
- 20
-
-
- 139
-
-
-
-
- 2016-05-20T13:48:33.648790+00:00
- 1594.6
-
- 152
-
- 21
-
-
- 145
-
-
-
-
- 2016-05-20T13:48:36.770050+00:00
- 1606.0
-
- 152
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:39.499600+00:00
- 1616.2
-
- 152
-
- 20
-
-
- 138
-
-
-
-
- 2016-05-20T13:48:42.559140+00:00
- 1627.4
-
- 152
-
- 21
-
-
- 140
-
-
-
-
- 2016-05-20T13:48:45.439020+00:00
- 1638.0
-
- 152
-
- 21
-
-
- 144
-
-
-
-
- 2016-05-20T13:48:48.439810+00:00
- 1649.2
-
- 151
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:51.379570+00:00
- 1660.2
-
- 152
-
- 20
-
-
- 143
-
-
-
-
- 2016-05-20T13:48:54.259600+00:00
- 1670.8
-
- 151
-
- 20
-
-
- 142
-
-
-
-
- 2016-05-20T13:48:57.139300+00:00
- 1681.4
-
- 151
-
- 21
-
-
- 140
-
-
-
-
- 2016-05-20T13:49:00.049550+00:00
- 1692.1
-
- 151
-
- 21
-
-
- 140
-
-
-
-
- 2016-05-20T13:49:02.838790+00:00
- 1702.5
-
- 150
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:49:05.839540+00:00
- 1713.7
-
- 150
-
- 21
-
-
- 144
-
-
-
-
- 2016-05-20T13:49:08.749400+00:00
- 1724.4
-
- 150
-
- 21
-
-
- 146
-
-
-
-
- 2016-05-20T13:49:11.689540+00:00
- 1735.1
-
- 150
-
- 20
-
-
- 141
-
-
-
-
- 2016-05-20T13:49:14.538900+00:00
- 1745.6
-
- 150
-
- 21
-
-
- 140
-
-
-
-
- 2016-05-20T13:49:17.389440+00:00
- 1756.3
-
- 150
-
- 21
-
-
- 141
-
-
-
-
- 2016-05-20T13:49:20.058880+00:00
- 1766.2
-
- 151
-
- 20
-
-
- 142
-
-
-
-
- 2016-05-20T13:49:23.059530+00:00
- 1777.1
-
- 150
-
- 22
-
-
- 138
-
-
-
-
- 2016-05-20T13:49:25.880610+00:00
- 1787.5
-
- 150
-
- 21
-
-
- 138
-
-
-
-
- 2016-05-20T13:49:28.608730+00:00
- 1797.7
-
- 150
-
- 22
-
-
- 140
-
-
-
-
- 2016-05-20T13:49:31.582600+00:00
- 1808.4
-
- 150
-
- 21
-
-
- 140
-
-
-
-
- 2016-05-20T13:49:34.278700+00:00
- 1818.4
-
- 149
-
- 21
-
-
- 138
-
-
-
-
- 2016-05-20T13:49:37.068660+00:00
- 1828.9
-
- 149
-
- 22
-
-
- 146
-
-
-
-
- 2016-05-20T13:49:40.039460+00:00
- 1839.9
-
- 149
-
- 21
-
-
- 142
-
-
-
-
- 2016-05-20T13:49:42.889790+00:00
- 1850.5
-
- 148
-
- 21
-
-
- 142
-
-
-
-
- 2016-05-20T13:49:45.772580+00:00
- 1861.2
-
- 148
-
- 21
-
-
- 145
-
-
-
-
- 2016-05-20T13:49:48.708690+00:00
- 1871.9
-
- 147
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:49:51.679450+00:00
- 1882.6
-
- 147
-
- 20
-
-
- 139
-
-
-
-
- 2016-05-20T13:49:54.499470+00:00
- 1893.3
-
- 148
-
- 20
-
-
- 140
-
-
-
-
- 2016-05-20T13:49:57.409440+00:00
- 1904.3
-
- 149
-
- 21
-
-
- 144
-
-
-
-
- 2016-05-20T13:50:00.439330+00:00
- 1915.4
-
- 149
-
- 20
-
-
- 148
-
-
-
-
- 2016-05-20T13:50:03.408680+00:00
- 1926.2
-
- 150
-
- 20
-
-
- 139
-
-
-
-
- 2016-05-20T13:50:06.378680+00:00
- 1937.3
-
- 151
-
- 20
-
-
- 140
-
-
-
-
- 2016-05-20T13:50:09.168860+00:00
- 1947.8
-
- 152
-
- 20
-
-
- 144
-
-
-
-
- 2016-05-20T13:50:12.229650+00:00
- 1959.1
-
- 152
-
- 20
-
-
- 142
-
-
-
-
- 2016-05-20T13:50:15.138650+00:00
- 1969.8
-
- 153
-
- 20
-
-
- 140
-
-
-
-
- 2016-05-20T13:50:18.049470+00:00
- 1980.6
-
- 153
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:50:20.959460+00:00
- 1991.4
-
- 153
-
- 21
-
-
- 143
-
-
-
-
- 2016-05-20T13:50:23.242360+00:00
- 2000.0
-
- 154
-
- 21
-
-
- 147
-
-
-
-
-
- <Element 'Notes' at 0x14f48668>
-
-
-
- rowsandall.com/rowingdata
-
-
- rowingdata
-
-
- 0
- 75
-
- Release
-
- EN
- 000-00000-00
-
-
diff --git a/rowers/views.py b/rowers/views.py
index 396cf585..6400c2e4 100644
--- a/rowers/views.py
+++ b/rowers/views.py
@@ -1102,9 +1102,9 @@ def billing_view(request):
setattr(r, attr, value)
r.save()
- if planselectform.is_valid():
- plan = planselectform.cleaned_data['plan']
- if billingaddressform.is_valid():
+ if billingaddressform.is_valid():
+ if planselectform.is_valid():
+ plan = planselectform.cleaned_data['plan']
try:
customer_id = braintreestuff.create_customer(r)
except ProcessorCustomerError:
@@ -1116,6 +1116,7 @@ def billing_view(request):
'planid':plan.id
})
return HttpResponseRedirect(url)
+
else:
billingaddressform = RowerBillingAddressForm(instance=r)