From cdeb15dc13410d18dd61a75d96eb225b68f7492b Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Fri, 10 Apr 2020 13:30:32 +0200
Subject: [PATCH 1/2] moved one more basic rule check to rules
---
rowers/rower_rules.py | 4 ++++
rowers/teams.py | 7 +++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/rowers/rower_rules.py b/rowers/rower_rules.py
index c66a37ee..f584c5a5 100644
--- a/rowers/rower_rules.py
+++ b/rowers/rower_rules.py
@@ -83,6 +83,10 @@ def user_is_not_basic(user):
return False
+@rules.predicate
+def user_is_basic(user):
+ return not user_is_not_basic(user)
+
@rules.predicate
def can_start_trial(user):
if user.is_anonymous:
diff --git a/rowers/teams.py b/rowers/teams.py
index 3ecefcd4..5e81b424 100644
--- a/rowers/teams.py
+++ b/rowers/teams.py
@@ -27,7 +27,7 @@ from rowers.models import (
CoachingGroup
)
-from rowers.rower_rules import is_team_manager,is_team_member,is_coach
+from rowers.rower_rules import is_team_manager,is_team_member,is_coach, user_is_basic
from rowers.tasks import (
handle_sendemail_invite,
@@ -79,9 +79,8 @@ def update_team(t,name,manager,private,notes,viewing):
def create_team(name,manager,private='open',notes='',viewing='allmembers'):
# needs some error testing
- if manager.rower.rowerplan == 'basic':
- if manager.rower.protrialexpires < timezone.now().date() and manager.rower.plantrialexpires < timezone.now().date():
- return (0,'You need to upgrade to a paid plan to establish a team')
+ if user_is_basic(manager.rower.user):
+ return (0,'You need to upgrade to a paid plan to establish a team')
if not is_coach(manager):
ts = Team.objects.filter(manager=manager)
if len(ts)>=1:
From 3b76a541f0ab907297bf1072036766e2c4b93717 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Fri, 10 Apr 2020 14:12:51 +0200
Subject: [PATCH 2/2] resolve #531
---
rowers/templates/partners.html | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/rowers/templates/partners.html b/rowers/templates/partners.html
index 237a0df7..b7365c4a 100644
--- a/rowers/templates/partners.html
+++ b/rowers/templates/partners.html
@@ -20,7 +20,8 @@
community. To maintain maximum transparency to our users, we have
the following principles for collaboration:
- On blog.rowsandall.com, analytics.rowsandall.com and through
+
On blog.rowsandall.com,
+ analytics.rowsandall.com and through
our Twitter account, we write about hardware, software, and other
rowing related kit that we have used, tested, and are enthusiastic about.
@@ -32,9 +33,9 @@
We do not formally publish product reviews, however, we may or
may not
mention your product
- on blog.rowsandall.com
+ on blog.rowsandall.com
or
- analytics.rowsandall.com.
+ analytics.rowsandall.com.
If there are reasons why we are not satisfied with the unit, but
we feel that an improved version would serve the rowing community,
we may contact you with constructive criticism. We try to not mention
@@ -64,7 +65,7 @@
your business. We are open for other models. If you have an interesting
proposition or want to use one of the partnership models listed below,
please contact us by email.
-
+
- Sponsorship of Pro membership.
You distribute coupon codes giving right to a year of