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 @@   BASIC PRO - SELF-COACH - COACH - Free COACH @@ -35,146 +32,92 @@ Basic rowing metrics (spm, time, distance, heart rate, power) ✔ ✔ - ✔ - ✔ - ✔ Manual Import, Export, Synchronization and download of all your data ✔ ✔ - ✔ - ✔ - ✔ Heart rate and power zones ✔ ✔ - ✔ - ✔ - ✔ Ranking Pieces, Stroke Analysis ✔ ✔ + + + Compare Workouts ✔ ✔ + + + Automatic Synchronization with other fitness sites + ✔ ✔ All other rowing metrics (Work per Stroke, Average and Peak Force, Drive Length, Catch and Finish Angle, Slip and Wash, Peak Force Angle, and more)   ✔ - ✔ - ✔ - ✔ - - - Automatic Synchronization with other fitness sites -   - ✔ - ✔ - ✔ -   Advanced Analysis (Critical Power, Stats, Box Chart, Trend Flex)   ✔ - ✔ - ✔ - ✔* - - - Compare Workouts -   - ✔ - ✔ - ✔ - ✔* Empower Stroke Profile   ✔ - ✔ - ✔ - ✔* Sensor Fusion, Split Workout, In-stroke metrics   ✔ - ✔ - ✔ - ✔* Create and manage groups.   - ✔ (max 1) - ✔ (max 1) - ✔ ✔ Create Training plans, tests and challenges for yourself and your training group. Track your performance against plan.   -   ✔ - ✔ -   Create Training plans, tests and challenges for your athletes. Track their performance against plan.   -   -   - ✔ ✔ Manage your athlete's workouts   -   -   - ✔ ✔ Run analytics for your athletes   -   -   ✔ - ✔* Change zone intensities and other workout related settings for your athletes   -   -   - ✔ ✔ Pricing FREE From 25€/year - From 75€/year - From 90€/year - Free     -   -   -   {% if rower %} @@ -193,27 +136,11 @@   {% endif %} - - {% if rower.rowerplan == 'plan' %} -

    SELF-COACH ({{ rower.paymenttype }})

    - {% else %} -   - {% endif %} - - - {% if rower.rowerplan == 'coach' %} -

    COACH ({{ rower.paymenttype }})

    - {% elif rower.rowerplan == 'freecoach' %} -

    Free COACH

    - {% else %} -   - {% endif %} - {% endif %} - Available trials (no strings attached) + Available trial (no strings attached)   @@ -231,40 +158,6 @@   {% endif %} - - {% if user.is_anonymous %} - - {% elif rower and rower.rowerplan == 'basic' and rower.plantrialexpires|date_dif == 1 %} - - {% elif rower and rower.rowerplan == 'pro' and rower.plantrialexpires|date_dif == 1 %} - - {% else %} -   - {% endif %} - - - {% if user.is_anonymous %} - - {% elif rower and rower.rowerplan == 'basic' and rower.coachtrialexpires|date_dif == 1 %} - - {% elif rower and rower.rowerplan == 'pro' and rower.coachtrialexpires|date_dif == 1 %} - - {% else %} -   - {% endif %} - @@ -289,79 +182,16 @@ {% endif %} - {% elif rower and rower.rowerplan == 'freecoach' %} - - - - {% elif rower and rower.rowerplan == 'pro' %} -   - - - - {% elif rower and rower.rowerplan == 'plan' %} -   -   - - - - -   - {% endif %}

    -

    Coach and Self-Coach Membership

    - - -

    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.

    -

    Terms and Conditions, Contact Information

    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