Private
Public Access
1
0

Merge branch 'release/v18.6.8'

This commit is contained in:
Sander Roosendaal
2022-09-04 21:11:17 +02:00
4 changed files with 11 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ class RowerInline(admin.StackedInline):
('Billing Details',
{'fields': ('street_address', 'city', 'postal_code', 'country', 'paymentprocessor', 'customer_id')}),
('Rower Plan',
{'fields': ('paidplan', 'rowerplan', 'paymenttype', 'planexpires', 'teamplanexpires', 'protrialexpires', 'plantrialexpires', 'eurocredits', 'clubsize', 'offercoaching')}),
{'fields': ('paidplan', 'rowerplan', 'paymenttype', 'planexpires', 'teamplanexpires', 'protrialexpires', 'plantrialexpires', 'coachtrialexpires', 'eurocredits', 'clubsize', 'offercoaching')}),
('Rower Settings',
{'fields':
('surveydone', 'surveydonedate', 'gdproptin', 'gdproptindate', 'weightcategory', 'sex', 'adaptiveclass', 'birthdate', 'getemailnotifications',

View File

@@ -99,6 +99,8 @@ def user_is_coachee(user):
for coach in coaches:
if coach.rowerplan == 'coach':
return True
if coach.coachtrialexpires >= timezone.now().date():
return True
return False
@@ -153,6 +155,8 @@ def is_not_freecoach(user):
def is_paid_coach(user):
if user.rower.coachtrialexpires >= timezone.now().date():
return True
return user.rower.rowerplan == 'coach'
@@ -750,6 +754,8 @@ def is_team_member(user, team): # pragma: no cover
@rules.predicate
def can_view_team(user, team):
# user based - below untested
if team.manager.rower.coachtrialexpires >= timezone.now().date():
return True
if user.rower.rowerplan == 'basic' and team.manager.rower.rowerplan != 'coach': # pragma: no cover
return is_plantrial(user) or is_protrial(user) or is_coachtrial(user)
# team is public

View File

@@ -646,6 +646,7 @@ def process_invite_code(user, code): # pragma: no cover
result, comment = add_member(t.id, r)
if not result:
return (result, "The member couldn't be added")

View File

@@ -383,8 +383,9 @@ def rower_exportsettings_view(request, userid=0):
cd = form.cleaned_data
if r.rowerplan == 'basic': # pragma: no cover
messages.error(
request, 'These settings can only be set if you are a user" \
" on one of the <a href="/rowers/paidplans">paid plans</a>.')
request, 'This setting will only be effective if you are a user \
on one of the <a href="/rowers/paidplans">paid plans</a> \
or part of a coaching group.')
for attr, value in cd.items():
doset = True