diff --git a/rowers/idoklad.py b/rowers/idoklad.py index 4156e12e..cb6f2593 100644 --- a/rowers/idoklad.py +++ b/rowers/idoklad.py @@ -59,10 +59,15 @@ def idoklad_token(): response = requests.post('https://identity.idoklad.cz/server/connect/token', headers=headers, data=data) if response.status_code == 200: - token = response.json() - token['updated_at'] = timezone.now() - token = iDokladToken.objects.filter(id=1).update(**token) - return iDokladToken.objects.get(id=1) + token_json = response.json() + token = iDokladToken.objects.all().order_by('-updated_at')[0] + token.access_token = token_json['access_token'] + token.id_token = token_json['id_token'] + token.refresh_token = token_json['refresh_token'] + token.expires_in = token_json['expires_in'] + token.updated_at = timezone.now() + token.save() + return token else: return None diff --git a/rowers/templates/paidplans.html b/rowers/templates/paidplans.html index 836d4e44..36cc5f20 100644 --- a/rowers/templates/paidplans.html +++ b/rowers/templates/paidplans.html @@ -9,7 +9,7 @@
Rowsandall.com offers free data and analysis for rowers, by rowers. Of course, offering this service is not free. To help cover the - hosting costs, we have created paid plans offering extended + hosting costs, we have created a paid plan offering extended functionality.
@@ -25,9 +25,6 @@
Rowsandall.com's Training Planning functionality - is part of the paid "Self-Coach" and "Coach" plans.
- -On the "Self-Coach" plan, you can plan your own sessions.
- -On the "Coach" plan, you can establish teams, see workouts done by - athletes on your team, and plan individual and group sessions for your - athletes. +
+ Payment methods: We accept credit card payments and PayPal through Braintree.
-The Coach plan functionality listed is available to the coach only. - Individual athletes - can purchase upgrades to "Pro" and "Self-Coach" plans. -
- -- The Coach plans come in two versions: free and paid. On the free coach plan, - you can only have athletes who are on the PRO paid plans or higher, and you - cannot upload any workouts to your own account. Some of the advanced Analysis functionality - becomes available when the athlete group is larger than 4. - On the paid - plans, your athletes can be on the free plan, and you have full access to the - site functionality for your own workouts and those of your athletes. -
- -If you would like to find a coach who helps you plan your training - through rowsandall.com, contact me throught the contact form.
-diff --git a/rowers/tests/test_analysis.py b/rowers/tests/test_analysis.py index c2bd1f89..a6d6533d 100644 --- a/rowers/tests/test_analysis.py +++ b/rowers/tests/test_analysis.py @@ -21,7 +21,7 @@ class ListWorkoutTest(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -80,7 +80,7 @@ class PlannedSessionTests(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -135,7 +135,7 @@ class ForcecurveTest(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -275,7 +275,7 @@ class WorkoutCompareTestNew(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -377,7 +377,7 @@ class WorkoutBoxPlotTestNew(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -478,7 +478,7 @@ class WorkoutHistoTestNew(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -579,7 +579,7 @@ class History(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(20, user=self.r) @@ -670,7 +670,7 @@ class GoldMedalScores(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(20, user=self.r) @@ -774,7 +774,7 @@ class WorkoutFlexallTestNew(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -875,7 +875,7 @@ class WorkoutStatsTestNew(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -1188,7 +1188,7 @@ class MarkerPerformanceTest(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) @@ -1366,7 +1366,7 @@ class AlertTest(TestCase): birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True,surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach') + rowerplan='pro') self.c = Client() self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) diff --git a/rowers/tests/test_payments.py b/rowers/tests/test_payments.py index 0ecd7776..ca1bb30a 100644 --- a/rowers/tests/test_payments.py +++ b/rowers/tests/test_payments.py @@ -183,7 +183,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -242,7 +242,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -306,7 +306,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -373,7 +373,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -507,7 +507,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -548,7 +548,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -570,7 +570,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -617,7 +617,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -663,7 +663,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -708,7 +708,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), @@ -759,7 +759,7 @@ description: "" birthdate=faker.profile()['birthdate'], gdproptin=True, ftpset=True, surveydone=True, gdproptindate=timezone.now(), - rowerplan='coach', + rowerplan='pro', paymentprocessor='braintree', street_address=faker.street_address(), city=faker.city(), diff --git a/rowers/tests/test_rowerplans.py b/rowers/tests/test_rowerplans.py index e662bf2c..9e311f6e 100644 --- a/rowers/tests/test_rowerplans.py +++ b/rowers/tests/test_rowerplans.py @@ -41,28 +41,7 @@ class TrialsTest(TestCase): self.r.protrialexpires = (nu+datetime.timedelta(days=10)).date() self.r.save() - self.assertEqual(isplanmember(self.u),False) - self.assertEqual(iscoachmember(self.u),False) - self.assertEqual(ispromember(self.u),True) - - self.r.plantrialexpires = (nu+datetime.timedelta(days=10)).date() - self.r.save() - self.assertEqual(isplanmember(self.u),True) - self.assertEqual(iscoachmember(self.u),False) + self.assertEqual(iscoachmember(self.u),True) self.assertEqual(ispromember(self.u),True) - def test_protrial(self): - self.r.rowerplan = 'pro' - self.r.save() - self.assertEqual(isplanmember(self.u),False) - self.assertEqual(iscoachmember(self.u),False) - self.assertEqual(ispromember(self.u),True) - - self.r.plantrialexpires = (nu+datetime.timedelta(days=10)).date() - self.r.save() - - self.assertEqual(is_plantrial(self.u),True) - self.assertEqual(isplanmember(self.u),True) - self.assertEqual(iscoachmember(self.u),False) - self.assertEqual(ispromember(self.u),True) diff --git a/rowers/tests/test_urls.py b/rowers/tests/test_urls.py index 829f7864..5e30c26c 100644 --- a/rowers/tests/test_urls.py +++ b/rowers/tests/test_urls.py @@ -25,7 +25,7 @@ class URLTests(TestCase): 'sander@ds.ds', 'koeinsloot', ) - r = Rower.objects.create(user=u,rowerplan='coach',gdproptin=True, ftpset=True, + r = Rower.objects.create(user=u,rowerplan='pro',gdproptin=True, ftpset=True, gdproptindate=timezone.now()) self.c = Client() cs = courses.kmltocourse('rowers/tests/testdata/thyro.kml') diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index d32442bd..54dd88b6 100644 Binary files a/rowers/tests/testdata/testdata.tcx.gz and b/rowers/tests/testdata/testdata.tcx.gz differ